moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
323 stars 129 forks source link

feat: prevent timing out one tab or window if another tab have activity #33

Closed roupify closed 7 years ago

roupify commented 7 years ago

Add a LocalStorageExpiry that put the expiry value in LocalStorage. If localStorage is not supported by the browser, will store the expiry value in memory.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

Multiple tabs or windows wasn't supported.

What is the new behavior?

Now, the expiry value is set in the localStorage by default, and if a browser doesn't support it (i.e. Safari in private mode), we store the expiry value in memory.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.6%) to 98.267% when pulling 2be6a455011dacf53a9d9a2d57a9307d3df5c8e1 on rousseaufiliong:localStorage into a6828265725fd59c2e3f62122d504a9754f1c154 on HackedByChinese:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.08%) to 98.762% when pulling 50d30c4290df52a13af7d9f545310376a92e0d51 on rousseaufiliong:localStorage into a6828265725fd59c2e3f62122d504a9754f1c154 on HackedByChinese:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 99.01% when pulling 1f8b29c6d3bf54e106c8054cf54bb58fc3f65508 on rousseaufiliong:localStorage into a6828265725fd59c2e3f62122d504a9754f1c154 on HackedByChinese:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.4%) to 99.279% when pulling cfd0b1535f4831cb866f26e2f12f4d8aba5b4c42 on rousseaufiliong:localStorage into a6828265725fd59c2e3f62122d504a9754f1c154 on HackedByChinese:master.