In our application, we have to get the user context from our backend service. If user context changes, application needs to reload. Since user could change their context in a different tab. We ping our backend service every 5 sec to check if user context has changed.
Is there a way to detect whether user has deactivated or activated the current tab? It would save pinging the backend every 5 sec.
User could change context in different tab of the same application or another application.