1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-17 16:18:27 +09:00

fix(friendly): Fixed an issue with notifications automatically disappearing in desktop mode

This commit is contained in:
NoriDev 2022-09-09 14:00:10 +09:00
parent bb6bf6d995
commit 48764485d0

View File

@ -17,14 +17,19 @@ import { i18n } from '@/i18n';
const isFriendly = $ref(localStorage.getItem('ui') === 'friendly'); const isFriendly = $ref(localStorage.getItem('ui') === 'friendly');
const DESKTOP_THRESHOLD = 1100;
const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD);
let showing = $ref(true); let showing = $ref(true);
let hasDisconnected = $ref(false); let hasDisconnected = $ref(false);
let currentTimeout = $ref(0); let currentTimeout = $ref(0);
function timeout() { function timeout() {
currentTimeout = window.setTimeout(() => { if (!isDesktop.value) {
showing = !isFriendly; currentTimeout = window.setTimeout(() => {
}, 10000); showing = !isFriendly;
}, 10000);
}
} }
function clearTimeout() { function clearTimeout() {