Changing page = reset the keepalive counter.

caa
Philippe Pittoli 2024-11-14 23:34:48 +01:00
parent 66c050ad0c
commit db2f64cc80
1 changed files with 3 additions and 0 deletions

View File

@ -354,6 +354,9 @@ handleAction = case _ of
H.tell _nav unit $ NavigationInterface.TellLogin (Just name) H.tell _nav unit $ NavigationInterface.TellLogin (Just name)
Routing page -> do Routing page -> do
-- Each time the user change load a new page, the counter gets reset
-- since it proves they are still active.
H.modify_ _ { keepalive_counter = 0 }
-- Store the current page we are on and restore it when we reload. -- Store the current page we are on and restore it when we reload.
sessionstorage <- H.liftEffect $ Window.sessionStorage =<< HTML.window sessionstorage <- H.liftEffect $ Window.sessionStorage =<< HTML.window
H.liftEffect $ Storage.setItem "current-page" (case page of H.liftEffect $ Storage.setItem "current-page" (case page of