mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
auto switch corresponding tab when the notification center is opened
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
<script setup>
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@/components/ui/sheet';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { ref } from 'vue';
|
||||
import { ref, watch } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
@@ -93,6 +93,20 @@
|
||||
|
||||
const activeTab = ref('friend');
|
||||
|
||||
watch(isNotificationCenterOpen, (open) => {
|
||||
if (open) {
|
||||
if (unseenFriendNotifications.value.length) {
|
||||
activeTab.value = 'friend';
|
||||
} else if (unseenGroupNotifications.value.length) {
|
||||
activeTab.value = 'group';
|
||||
} else if (unseenOtherNotifications.value.length) {
|
||||
activeTab.value = 'other';
|
||||
} else {
|
||||
activeTab.value = 'friend';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Dialog state
|
||||
const sendInviteResponseDialog = ref({
|
||||
messageSlot: {},
|
||||
|
||||
Reference in New Issue
Block a user