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
It will now throw an error when promptBeforeIdle >= timeout. You should never hit this when configured correctly, but safety is nice.
I understand what you mean by 'configured correctly', but when I checked the docs at idletimer.dev, there is nothing there that mentions that timeout must be > promptBeforeIdle, and the demo on the main page allows for idle > timeout and it seems to work correctly there. Which is why I raised the issue, it seems like the issue may be in the wrapper.
Bug information
Affected Module
useIdleTimer
Version
: v5.6.0Describe the bug
If you set timeout and promptBeforeIdle to the same value (eg. 60000), the onPrompt event will trigger continuously.
To Reproduce
Steps to reproduce the behavior:
when calling useIdleTimer, assign the same value (or const) to the timeout and promptBeforeIdle properties.
Expected behavior
It should allow the same values to be used - eg. 60000 and 60000
Screenshots
const { getRemainingTime, activate } = useIdleTimer({
onIdle: () => setIsOpen(false),
onActive: () => setIsOpen(false),
onPrompt: () => {
console.log("onPrompt");
setIsOpen(true);
},
timeout: 60000,
promptBeforeIdle: 60000,
throttle: 500
});
System Information (please complete the following information)
OS
: Windows 10Device
: [e.g. iPhone6, Desktop]Browser Vendor
: chrome & edgeBrowser Version
: [e.g. 75]Additional context
Add any other context about the problem here.
Code sample:
app.js
useIdleTimerModal.js
The text was updated successfully, but these errors were encountered: