fix types

This commit is contained in:
kakkokari-gtyih 2024-10-24 23:33:40 +09:00
parent 5df22b67b6
commit a93ef485c1
1 changed files with 3 additions and 3 deletions

View File

@ -27,14 +27,14 @@ const hasDisconnected = ref(false);
let timeoutId: number | null = null;
function onDisconnected() {
window.clearTimeout(timeoutId);
if (timeoutId != null) window.clearTimeout(timeoutId);
timeoutId = window.setTimeout(() => {
hasDisconnected.value = true;
}, 1000 * 10);
}
function resetDisconnected() {
window.clearTimeout(timeoutId);
if (timeoutId != null) window.clearTimeout(timeoutId);
hasDisconnected.value = false;
}
@ -46,7 +46,7 @@ useStream().on('_connected_', resetDisconnected);
useStream().on('_disconnected_', onDisconnected);
onUnmounted(() => {
window.clearTimeout(timeoutId);
if (timeoutId != null) window.clearTimeout(timeoutId);
useStream().off('_connected_', resetDisconnected);
useStream().off('_disconnected_', onDisconnected);
});