Skip to content

Commit

Permalink
feat: If the last message is disconnect type, then do not push new me…
Browse files Browse the repository at this point in the history
…ssage to list
  • Loading branch information
kungfuboy committed Sep 9, 2022
1 parent 789045c commit 5e66526
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ export class WebsocketComponent implements OnInit, OnDestroy {
}
}
if (type === 'ws-message-back' && status === 0) {
const { type: msgType } = this.model.response.responseBody.at();
if (msgType === 'end') {
// * If the last message is disconnect type, then do not push new message to list
return;
}
this.model.response.responseBody.unshift({ type: 'get', msg: content, isExpand: false });
}
});
Expand Down

0 comments on commit 5e66526

Please sign in to comment.