From a93ef485c16500470dfba68070862bf97814257d Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 24 Oct 2024 23:33:40 +0900 Subject: [PATCH] fix types --- packages/frontend/src/ui/_common_/stream-indicator.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/ui/_common_/stream-indicator.vue b/packages/frontend/src/ui/_common_/stream-indicator.vue index 363b72ded8..bf4fcb23d1 100644 --- a/packages/frontend/src/ui/_common_/stream-indicator.vue +++ b/packages/frontend/src/ui/_common_/stream-indicator.vue @@ -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); });