User can not see reply message in chat app using signalr + angular

依然范特西╮ 提交于 2021-01-07 02:34:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!