X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3c7e3cdc547ad5468421e1c049daa94b0d4b8bc0..7f160d39308e02e571543b2958320f387b5372ab:/src/views-components/auto-logout/auto-logout.tsx diff --git a/src/views-components/auto-logout/auto-logout.tsx b/src/views-components/auto-logout/auto-logout.tsx index c6c1feee..a2d71d08 100644 --- a/src/views-components/auto-logout/auto-logout.tsx +++ b/src/views-components/auto-logout/auto-logout.tsx @@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch: Dispatch): AutoLogoutActionProps => ({ 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(() => { @@ -63,7 +63,7 @@ export const AutoLogoutComponent = (props: AutoLogoutProps) => { return () => { window.removeEventListener('storage', handleStorageEvents); }; - }, []); + }); const handleStorageEvents = (e: StorageEvent) => { if (e.key === LAST_ACTIVE_TIMESTAMP) { @@ -90,7 +90,7 @@ export const AutoLogoutComponent = (props: AutoLogoutProps) => { 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()); };