Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng2-idle pauses when the tab is in the background #184

Closed
JiaLinYou opened this issue Feb 15, 2023 · 3 comments
Closed

ng2-idle pauses when the tab is in the background #184

JiaLinYou opened this issue Feb 15, 2023 · 3 comments
Labels

Comments

@JiaLinYou
Copy link

NOTE: Due to limited time constraints and resources, we ask that you please use Stack Overflow or similar to troubleshoot or ask general questions, and not use bug reports to solicit help setting up your app.

Describe the bug
When the application tab is in the background, onTimeout, onIdleStart, onTimeoutWarning will not be triggered.
For example, The logic of the code is to jump to a page after timeout, so if I set the onTimeout parameter to 15s, then it will time out 15 seconds after entering Idle and jump to the page, so when I switch back to this tab page, I should see the page after the jump instead of the previous tab.

To Reproduce
Use the DEFAULT_INTERRUPTSOURCES. Set the idle time to 15s, and the timeout to15s.
Start up app Immediately upon restarting the apps, minimize the browser window.
You should see the new page after 30s.

Expected behavior
I hope that when the browser is in the background, it can automatically jump when Idle timeout.

Please tell us about your environment

  • Mobile or Desktop: Desktop
  • Browser: Edge
  • Version: Version 110.0.1587.41 (Official build) (64-bit)
  • Angular version: 8.2.x
  • NodeJS version: v14.17.5
  • Language (TypeScript x.x, ES5, ES2015, etc.): TypeScript version 3.5.3, ES5
@JiaLinYou JiaLinYou added the bug label Feb 15, 2023
@girish-fuluskar
Copy link

I am also facing the same issue but only for iOS. For Android it is working as expected but for iOS it is not working. Does anyone have any solution for the same?

@asfo
Copy link

asfo commented May 17, 2023

The only way I think that we can handle that is we store the "latest tick" on a sessionStorage and once the tab is recovered validate from there and keep counting, if the time happens, runs the "timeout function".

Otherwise, we don't have too many ways to do that.

@grbsk
Copy link
Owner

grbsk commented Nov 21, 2023

See if #131 fixes the issue for you

@grbsk grbsk closed this as completed Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants