Jquery simultaneous duplicate chat notifications

Asked

Viewed 42 times

0

Hello, I have a chat system that gives notifications in any part of the site where it is or on the same page of Chatt, however when I am with 2 open tabs I receive notification in both, ie, duplicated, would have some way to check if I have more than 2 open tabs of the same site in the browser to be able to make a filter and show only in a?

1 answer

1


I suggest you change your service that returns the messages that will be notified, so that when returning a message, you already mark it as "read" (one more field of the message table). And when returning messages, you only search for messages not yet read.

This way when the first tab receives the messages and shows them on the screen, they will be marked as read on the server. And the second tab will not receive any message, because all will be as read.

  • Thank you, I’ll try.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.