mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 12:15:47 -04:00
fix(web): setInterval outside onMount (#1883)
This commit is contained in:
parent
ab90b01122
commit
2efa8b6960
@ -10,6 +10,7 @@
|
||||
let isServerOk = true;
|
||||
let serverVersion = '';
|
||||
let serverInfo: ServerInfoResponseDto;
|
||||
let pingServerInterval: NodeJS.Timer;
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
@ -24,9 +25,8 @@
|
||||
console.log('Error [StatusBox] [onMount]');
|
||||
isServerOk = false;
|
||||
}
|
||||
});
|
||||
|
||||
const pingServerInterval = setInterval(async () => {
|
||||
pingServerInterval = setInterval(async () => {
|
||||
try {
|
||||
const { data: pingReponse } = await api.serverInfoApi.pingServer();
|
||||
|
||||
@ -40,6 +40,7 @@
|
||||
isServerOk = false;
|
||||
}
|
||||
}, 10000);
|
||||
});
|
||||
|
||||
onDestroy(() => clearInterval(pingServerInterval));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user