mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 22:06:06 +02:00
feat: add notification layout setting
This commit is contained in:
+19
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user