From 5df22b67b6f20f9531d3028689539c80af125837 Mon Sep 17 00:00:00 2001
From: riku6460 <17585784+riku6460@users.noreply.github.com>
Date: Fri, 6 Oct 2023 21:57:37 +0900
Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=90=E3=83=BC=E3=81=8B?=
 =?UTF-8?q?=E3=82=89=E5=88=87=E6=96=AD=E3=81=95=E3=82=8C=E3=81=9F=E5=BE=8C?=
 =?UTF-8?q?=20stream=20indicator=20=E3=82=92=E3=81=99=E3=81=90=E3=81=AB?=
 =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?=
 =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B=20(MisskeyIO#172)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

すぐに再接続されたら表示しないように
---
 packages/frontend/src/ui/_common_/stream-indicator.vue | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/packages/frontend/src/ui/_common_/stream-indicator.vue b/packages/frontend/src/ui/_common_/stream-indicator.vue
index cc62a28b14..363b72ded8 100644
--- a/packages/frontend/src/ui/_common_/stream-indicator.vue
+++ b/packages/frontend/src/ui/_common_/stream-indicator.vue
@@ -24,12 +24,17 @@ import { defaultStore } from '@/store.js';
 const zIndex = os.claimZIndex('high');
 
 const hasDisconnected = ref(false);
+let timeoutId: number | null = null;
 
 function onDisconnected() {
-	hasDisconnected.value = true;
+	window.clearTimeout(timeoutId);
+	timeoutId = window.setTimeout(() => {
+		hasDisconnected.value = true;
+	}, 1000 * 10);
 }
 
 function resetDisconnected() {
+	window.clearTimeout(timeoutId);
 	hasDisconnected.value = false;
 }
 
@@ -37,9 +42,12 @@ function reload() {
 	location.reload();
 }
 
+useStream().on('_connected_', resetDisconnected);
 useStream().on('_disconnected_', onDisconnected);
 
 onUnmounted(() => {
+	window.clearTimeout(timeoutId);
+	useStream().off('_connected_', resetDisconnected);
 	useStream().off('_disconnected_', onDisconnected);
 });
 </script>