feat: add notification layout setting

This commit is contained in:
pa
2026-03-24 10:22:09 +09:00
parent 0af5e33684
commit bb5a01ae49
7 changed files with 131 additions and 46 deletions
+19 -4
View File
@@ -16,6 +16,7 @@ import { showAvatarDialog } from '../coordinators/avatarCoordinator';
import { showUserDialog } from '../coordinators/userCoordinator';
import { useInstanceStore } from './instance';
import { useNotificationStore } from './notification';
import { useNotificationsSettingsStore } from './settings/notifications';
import { useSearchStore } from './search';
import { useUserStore } from './user';
import { useWorldStore } from './world';
@@ -286,6 +287,11 @@ export const useUiStore = defineStore('Ui', () => {
const name = String(routeName);
removeNotify(name);
if (name === 'notification') {
const notificationsSettingsStore = useNotificationsSettingsStore();
if (notificationsSettingsStore.notificationLayout === 'notification-center') {
router.replace({ name: 'feed' });
return;
}
notificationStore.clearUnseenNotifications();
}
}
@@ -314,10 +320,19 @@ export const useUiStore = defineStore('Ui', () => {
}
function updateTrayIconNotify(force = false) {
const newState =
appearanceSettings.notificationIconDot &&
(notifiedMenus.value.includes('notification') ||
notifiedMenus.value.includes('friend-log'));
const notificationsSettingsStore = useNotificationsSettingsStore();
let newState;
if (notificationsSettingsStore.notificationLayout === 'notification-center') {
newState =
appearanceSettings.notificationIconDot &&
(notificationStore.hasUnseenNotifications ||
notifiedMenus.value.includes('friend-log'));
} else {
newState =
appearanceSettings.notificationIconDot &&
(notifiedMenus.value.includes('notification') ||
notifiedMenus.value.includes('friend-log'));
}
if (trayIconNotify.value !== newState || force) {
trayIconNotify.value = newState;