2

I want to use Broadcast Channel API in my Angular application to maintain logged in state across tabs. But the tab from which the user is logging in needs to run a little different code than the other tabs. I am setting the handler for MessageEvent on application load. As a result, the tab generating the login message is also executing this handler, which it will because message is dispatched to all listeners. But in the listener, I want to be able to identify if the current tab was the source of message, in that case do nothing. Is there any simple way?

Urooj
  • 151
  • 7

0 Answers0