@@ -18,7 +18,7 @@ import { AdminMessage } from "@/submodules/react-components/types/admin-messages
1818import { postProcessAdminMessages } from "@/submodules/react-components/helpers/admin-messages-helper"
1919import AdminMessages from "@/submodules/react-components/components/AdminMessages"
2020import { useTranslation } from "react-i18next"
21- import { AutoLogoutProgressBar } from "@/submodules/react-components/components/AutoLogoutProgressBar"
21+ import AutoLogoutProgressBar from "@/submodules/react-components/components/AutoLogoutProgressBar"
2222
2323const Settings : NextPage = ( ) => {
2424 const [ initialFlow , setInitialFlow ] : any = useState < SettingsFlow > ( )
@@ -40,7 +40,6 @@ const Settings: NextPage = () => {
4040 const [ showAuthenticator , setShowAuthenticator ] = useState < boolean > ( false ) ;
4141 const [ loadPage , setLoadPage ] = useState < boolean > ( false ) ;
4242 const [ canShow , setCanShow ] = useState < boolean > ( false ) ;
43- const autoLogoutRef = useRef ( null ) ;
4443
4544 useEffect ( ( ) => {
4645 if ( loadPage ) return ;
@@ -83,26 +82,6 @@ const Settings: NextPage = () => {
8382 refetchAdminMessagesAndProcess ( ) ;
8483 } , [ ] ) ;
8584
86- useEffect ( ( ) => {
87- const resetTimer = ( ) => {
88- autoLogoutRef . current ?. resetTimer ( ) ;
89- }
90- const onKeyDownEvent = ( e : KeyboardEvent ) => {
91- const target = e . target as HTMLElement ;
92- // used for the chat input (we want to trigger rest on typing)
93- if ( target . tagName === "INPUT" || target . tagName === "TEXTAREA" ) {
94- resetTimer ( ) ;
95- }
96- } ;
97- window . addEventListener ( "click" , resetTimer ) ;
98- window . addEventListener ( "keydown" , onKeyDownEvent )
99- return ( ) => {
100- window . removeEventListener ( "click" , resetTimer ) ;
101- window . removeEventListener ( "keydown" , onKeyDownEvent )
102- } ;
103- } , [ ] ) ;
104-
105-
10685 const handleWebsocketNotification = useCallback ( ( msgParts : string [ ] ) => {
10786 if ( msgParts [ 1 ] == 'admin_message' ) {
10887 refetchAdminMessagesAndProcess ( ) ;
@@ -358,7 +337,7 @@ const Settings: NextPage = () => {
358337 </ div >
359338 < div className = "img-container" >
360339 </ div >
361- { ( language && loadPage ) && < AutoLogoutProgressBar ref = { autoLogoutRef } className = 'absolute right-2 top-2' autoLogoutMinutes = { user ?. autoLogoutMinutes } label = { t ( "overview.remainingTime" ) } comesFromEntry = { true } /> }
340+ { ( language && loadPage ) && < AutoLogoutProgressBar className = 'absolute right-2 top-2' autoLogoutMinutes = { user ?. autoLogoutMinutes } label = { t ( "overview.remainingTime" ) } comesFromEntry = { true } /> }
362341 < AdminMessages
363342 adminMessages = { activeAdminMessages }
364343 setActiveAdminMessages = { setActiveAdminMessages } />
0 commit comments