export type AutoLogoutProps = AutoLogoutDataProps & AutoLogoutActionProps;
const debounce = (delay: number | undefined, fn: Function) => {
- let timerId: number | null;
+ let timerId: NodeJS.Timer | null;
return (...args: any[]) => {
if (timerId) { clearTimeout(timerId); }
timerId = setTimeout(() => {
return () => {
window.removeEventListener('storage', handleStorageEvents);
};
- }, []);
+ });
const handleStorageEvents = (e: StorageEvent) => {
if (e.key === LAST_ACTIVE_TIMESTAMP) {
const handleOnAction = () => {
// Notify the other tabs there was some activity.
- const now = (new Date).getTime();
+ const now = (new Date()).getTime();
localStorage.setItem(LAST_ACTIVE_TIMESTAMP, now.toString());
};