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 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() {