This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let timeStamp; | |
let warningInactiveInterval = useRef(); | |
let startTimerInterval = useRef(); | |
// start inactive check | |
let timeChecker = () => { | |
startTimerInterval.current = setTimeout(() => { | |
let storedTimeStamp = sessionStorage.getItem('lastTimeStamp'); | |
warningInactive(storedTimeStamp); | |
}, 60000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SessionTimeout = () => { | |
const [events, setEvents] = useState(['click', 'load', 'scroll']); | |
const [second, setSecond] = useState(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
useState, | |
useEffect, | |
useCallback, | |
useRef, | |
Fragment, | |
} from 'react'; | |
import moment from 'moment'; | |
const SessionTimeout =()=> { |
NewerOlder