From 48764485d04b4dc5e6313ea4cfd4af3db294841e Mon Sep 17 00:00:00 2001 From: NoriDev Date: Fri, 9 Sep 2022 14:00:10 +0900 Subject: [PATCH] fix(friendly): Fixed an issue with notifications automatically disappearing in desktop mode --- packages/client/src/ui/_common_/stream-indicator.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/client/src/ui/_common_/stream-indicator.vue b/packages/client/src/ui/_common_/stream-indicator.vue index 84fa20d6e2..e0c7e2fd27 100644 --- a/packages/client/src/ui/_common_/stream-indicator.vue +++ b/packages/client/src/ui/_common_/stream-indicator.vue @@ -17,14 +17,19 @@ import { i18n } from '@/i18n'; const isFriendly = $ref(localStorage.getItem('ui') === 'friendly'); +const DESKTOP_THRESHOLD = 1100; +const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD); + let showing = $ref(true); let hasDisconnected = $ref(false); let currentTimeout = $ref(0); function timeout() { - currentTimeout = window.setTimeout(() => { - showing = !isFriendly; - }, 10000); + if (!isDesktop.value) { + currentTimeout = window.setTimeout(() => { + showing = !isFriendly; + }, 10000); + } } function clearTimeout() {