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

@ -47,9 +47,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { defineAsyncComponent, ref, watch } from 'vue';
import { defineAsyncComponent, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { setFavIconDot } from '../../scripts/favicon-dot';
import { swInject } from './sw-inject.js';
import XNotification from './notification.vue';
import { popups } from '@/os.js';
@ -95,11 +94,6 @@ if ($i) {
const connection = useStream().useChannel('main', null, 'UI');
connection.on('notification', onNotification);
// For the favicon notification dot
watch(() => $i?.hasUnreadNotification && defaultStore.state.enableFaviconNotificationDot, (hasAny) => setFavIconDot(hasAny as boolean));
if ($i.hasUnreadNotification && defaultStore.state.enableFaviconNotificationDot) setFavIconDot(true);
globalEvents.on('clientNotification', notification => onNotification(notification, true));
//#region Listen message from SW