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
There are a few methods that return null instead of boolean as shown below and I am a bit confused. For example the method below isLastActiveTab it's written that will return boolean but it returns null and boolean.|
Could you please explain a little bit the reasoning behind this?
Thanks!
For a bit of context, I am using this method to log a user out on a single tab to avoid errors when multiple tabs attempt to execute the logout request after the first one has completed.
/** * Returns whether this is the last active tab. */constisLastActiveTab=useCallback<()=>boolean>((): boolean=>{if(!manager.current)returnnullreturnmanager.current.isLastActive},[manager])
Reproduction Steps
See code below
https://github.com/SupremeTechnopriest/react-idle-timer/blob/master/src/useIdleTimer.tsx#L659
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.
Chrome
What devices are you seeing the problem on?
Desktop
Verification
I have checked for existing closed issues and discussions.
The text was updated successfully, but these errors were encountered:
What happened?
Hello!
There are a few methods that return
null
instead of boolean as shown below and I am a bit confused. For example the method belowisLastActiveTab
it's written that will return boolean but it returns null and boolean.|Could you please explain a little bit the reasoning behind this?
Thanks!
For a bit of context, I am using this method to log a user out on a single tab to avoid errors when multiple tabs attempt to execute the logout request after the first one has completed.
Reproduction Steps
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.
Chrome
What devices are you seeing the problem on?
Desktop
Verification
The text was updated successfully, but these errors were encountered: