mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
1c820de200
React IDE page: hook up events GitOrigin-RevId: 1121a30755fc600023f06925ca3eafa7a8e1ee14
10 lines
463 B
TypeScript
10 lines
463 B
TypeScript
import { useConnectionContext } from '@/features/ide-react/context/connection-context'
|
|
import useEventListener from '@/shared/hooks/use-event-listener'
|
|
import useDomEventListener from '@/shared/hooks/use-dom-event-listener'
|
|
|
|
export function useRegisterUserActivity() {
|
|
const { registerUserActivity } = useConnectionContext()
|
|
|
|
useEventListener('cursor:editor:update', registerUserActivity)
|
|
useDomEventListener(document.body, 'click', registerUserActivity)
|
|
}
|