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
I could have sworn that previously, onActive() only ran if isPrompted() was true. Now, it also runs if syncTimers is set to a value > 0.
Reproduction Steps
1.Create an onActive method with logging.
2.See what happens when you move the mouse with / without syncTimers set.
3.Note that syncTimers appears to now switch on / off calling onActive, even if not prompted.
...
Relevant log output
No response
Screenshots or Additional Context
No response
Module Version
5.7.2
What browsers are you seeing the problem on? Select all that apply.
No response
What devices are you seeing the problem on?
No response
Verification
I have checked for existing closed issues and discussions.
The text was updated successfully, but these errors were encountered:
onActive should not be called while prompted. This is by design so user action doesn't close your prompt. If you want to detect activity during the prompt phase, you should use onAction instead, as that is always called on every action.
Are you saying that when syncTimers is set, onActive is called in the prompted state? If so thats most likely a bug I will have to look into.
was hitting my API over and over when moving the mouse, and this was tied to syncTimers. If I commented out the syncTimers line, onActive() worked as expected (it didn't execute when not prompted).
For now I'm working around this by enabling syncTimers and wrapping the logic:
const onActive = () => {
if (isPrompted()) {
setOpen(false);
setRemaining(0);
if (isLeader()) {
doRefresh();
}
}
};
but my understanding is that I shouldn't need to do that.
That said, I was just looking into the idea of adding an onTimersSynced prop, because this is what I think I could use. I'm maintaining external times and activity states because we need to check actual timeout times with an external session-management server. If such a prop were added, I'd expect it to be always called, whether or not any tab was in isPrompted state.
The end result I'd like is for any tab (isPrompted or not) to be notified when another has its timeout value updated, and to know what that time is. And I may be running into bugs because of this logic feature and the way I've structured my timer component.
What happened?
I could have sworn that previously, onActive() only ran if isPrompted() was true. Now, it also runs if syncTimers is set to a value > 0.
Reproduction Steps
1.Create an onActive method with logging. 2.See what happens when you move the mouse with / without syncTimers set. 3.Note that syncTimers appears to now switch on / off calling onActive, even if not prompted. ...
Relevant log output
No response
Screenshots or Additional Context
No response
Module Version
5.7.2
What browsers are you seeing the problem on? Select all that apply.
No response
What devices are you seeing the problem on?
No response
Verification
The text was updated successfully, but these errors were encountered: