You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I have a project where something is running in the background, and sometimes create notifications, each with different timeouts.
This works fine, but if the browser is hidden on the screen, ie. minimized or something, it seems that all the notifications are shown all at once when the browser gets focus.
With all the timers also starting at once, which means that if the user has had the browser hidden for a while, it will fill the screen with notifications when the browser is then shown.
Ideally the timers would run behind the scenes, and if a notification 'expires', it should not be shown when the user opens the browser.
Alternatively I, if possible, should detect if the browser/tab is visible/active and only show notifications if that's the case - this is probably the solution I'm going with for now.
Has anyone else come up with another solution?
The text was updated successfully, but these errors were encountered:
No, unfortunately not - I am also still looking for a solution.
I'm thinking that it should be possible to hook into the code where the notifications are "published" and then check if the age exceeds the timeout, and remove it. I took a look at it but I was not really able to figure out where to do this.
Also there might not really be a good way to hook into it, as it might depend on the browser in some way.
@Moulde I'm using the Vue variant of snotify, but I ended up working around this issue using the following monkeypatch that prevents message queuing if the window is minimized or the tab is not active. Seems to behave correctly on Firefox and Chrome. Your mileage may vary.
So, I have a project where something is running in the background, and sometimes create notifications, each with different timeouts.
This works fine, but if the browser is hidden on the screen, ie. minimized or something, it seems that all the notifications are shown all at once when the browser gets focus.
With all the timers also starting at once, which means that if the user has had the browser hidden for a while, it will fill the screen with notifications when the browser is then shown.
Ideally the timers would run behind the scenes, and if a notification 'expires', it should not be shown when the user opens the browser.
Alternatively I, if possible, should detect if the browser/tab is visible/active and only show notifications if that's the case - this is probably the solution I'm going with for now.
Has anyone else come up with another solution?
The text was updated successfully, but these errors were encountered: