问题
I have chat application and in that backend is done by asp.net core and front end is in angular.
Everything is working fine, just problem is as per below :
Let's say User A send message to User B so User B see that message instantly.
But when User B reply back to User A then User A can not see message instantly, But if User A refresh page OR click on any other username and click back on User B then he can see that reply message of User B.
So any one can guide me what can be problem for this.
if (window['chatHub'].connectionState == "Connected") {
// alert("wwww");
this._userService.sendMessage(this.input)
.subscribe(resp => {
console.log(resp);
this.updateProfilePic(resp);
this.Messages.push(resp);
window['chatHub'].invoke('sendMessage', resp);
this.scrollToBottom();
this._formGroup.reset();
});
} else {
//this.message.info("Connection was lost! Please send message again", "Connection lost");
window['chatHub'].start();
}
来源:https://stackoverflow.com/questions/65510113/user-can-not-see-reply-message-in-chat-app-using-signalr-angular