|
|
|
|
@ -3,14 +3,12 @@ import { |
|
|
|
|
useEffect, |
|
|
|
|
useCallback, |
|
|
|
|
} from 'react' |
|
|
|
|
import { useLocation } from 'react-router' |
|
|
|
|
|
|
|
|
|
import round from 'lodash/round' |
|
|
|
|
|
|
|
|
|
import { LogActions, logUserAction } from 'requests/logUserAction' |
|
|
|
|
|
|
|
|
|
import { useEventListener } from 'hooks' |
|
|
|
|
import { useLocation } from 'react-router' |
|
|
|
|
|
|
|
|
|
export const usePageLogger = (page?: string) => { |
|
|
|
|
const location = useLocation() |
|
|
|
|
const startTimeRef = useRef(new Date()) |
|
|
|
|
@ -42,9 +40,4 @@ export const usePageLogger = (page?: string) => { |
|
|
|
|
log, |
|
|
|
|
resetTime, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
useEventListener({ |
|
|
|
|
callback: log, |
|
|
|
|
event: 'beforeunload', |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|