fixes & add button to see if notification dot works

This commit is contained in:
KevinWh0 2024-06-17 17:44:00 +02:00 committed by dakkar
parent 16ecc2e406
commit 88eb1a0c53
7 changed files with 84 additions and 19 deletions

View file

@ -141,6 +141,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="enableFaviconNotificationDot">{{ i18n.ts.enableFaviconNotificationDot }}</MkSwitch>
<MkButton @click="testNotificationDot">{{ i18n.ts.verifyNotificationDotWorkingButton }}</MkButton>
<MkRadios v-model="notificationPosition">
<template #label>{{ i18n.ts.position }}</template>
<option value="leftTop"><i class="ph-arrow-up-left ph-bold ph-lg"></i> {{ i18n.ts.leftTop }}</option>
@ -327,6 +329,7 @@ import { miLocalStorage } from '@/local-storage.js';
import { globalEvents } from '@/events.js';
import { claimAchievement } from '@/scripts/achievements.js';
import { deepMerge } from '@/scripts/merge.js';
import { worksOnInstance } from '@/scripts/favicon-dot';
const lang = ref(miLocalStorage.getItem('lang'));
const fontSize = ref(miLocalStorage.getItem('fontSize'));
@ -562,6 +565,16 @@ function testNotification(): void {
}, 300);
}
async function testNotificationDot() {
const success = await worksOnInstance();
if (success) {
os.toast(i18n.ts.notificationDotWorking);
} else {
os.toast(i18n.ts.notificationDotNotWorking);
}
}
function enableAllDataSaver() {
const g = { ...defaultStore.state.dataSaver };