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