mirror of
https://github.com/calli-eve/eve-pi.git
synced 2026-02-11 18:28:49 +01:00
add automatic refresh
This commit is contained in:
@@ -110,6 +110,14 @@ const Home = () => {
|
|||||||
.then(() => setSessionReady(true));
|
.then(() => setSessionReady(true));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const ESI_CACHE_TIME_MS = 600000;
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
const characters = initializeCharacters();
|
||||||
|
refreshSession(characters).then(saveCharacters).then(setCharacters);
|
||||||
|
}, ESI_CACHE_TIME_MS);
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<SessionContext.Provider
|
<SessionContext.Provider
|
||||||
value={{
|
value={{
|
||||||
|
|||||||
Reference in New Issue
Block a user