Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm using Pusher for one-to-one real time messages between two people. This is my code when you are in the "room"

Echo.private('chat.'+this.roomid)
    .listen('MessageSent',(e)=>{
          this.allMessages.push(e.message)
          this.scrollBottom(this.messagesContainer);
    });

My question is how should be the logic when you are outside every chat and you want to show a number of new messages to you next to a message icon in the navigation? Should it be a different event that is not tied to a chat "room" but rather just to a user?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
349 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...