mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Status fixes, fetch instance name for invites
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
import Noty from 'noty';
|
import Noty from 'noty';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { computed, reactive, watch } from 'vue';
|
import { computed, reactive, watch } from 'vue';
|
||||||
import { notificationRequest, userRequest, worldRequest } from '../api';
|
import {
|
||||||
|
instanceRequest,
|
||||||
|
notificationRequest,
|
||||||
|
userRequest,
|
||||||
|
worldRequest
|
||||||
|
} from '../api';
|
||||||
import configRepository from '../service/config';
|
import configRepository from '../service/config';
|
||||||
import { database } from '../service/database';
|
import { database } from '../service/database';
|
||||||
import { AppDebug } from '../service/appConfig';
|
import { AppDebug } from '../service/appConfig';
|
||||||
@@ -28,6 +33,7 @@ import { useWristOverlaySettingsStore } from './settings/wristOverlay';
|
|||||||
import { useSharedFeedStore } from './sharedFeed';
|
import { useSharedFeedStore } from './sharedFeed';
|
||||||
import { useUiStore } from './ui';
|
import { useUiStore } from './ui';
|
||||||
import { useUserStore } from './user';
|
import { useUserStore } from './user';
|
||||||
|
import { useInstanceStore } from './instance';
|
||||||
|
|
||||||
export const useNotificationStore = defineStore('Notification', () => {
|
export const useNotificationStore = defineStore('Notification', () => {
|
||||||
const generalSettingsStore = useGeneralSettingsStore();
|
const generalSettingsStore = useGeneralSettingsStore();
|
||||||
@@ -42,6 +48,7 @@ export const useNotificationStore = defineStore('Notification', () => {
|
|||||||
const uiStore = useUiStore();
|
const uiStore = useUiStore();
|
||||||
const gameStore = useGameStore();
|
const gameStore = useGameStore();
|
||||||
const sharedFeedStore = useSharedFeedStore();
|
const sharedFeedStore = useSharedFeedStore();
|
||||||
|
const instanceStore = useInstanceStore();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
notificationInitStatus: false,
|
notificationInitStatus: false,
|
||||||
notificationTable: {
|
notificationTable: {
|
||||||
@@ -149,6 +156,19 @@ export const useNotificationStore = defineStore('Notification', () => {
|
|||||||
database.addNotificationToDatabase(ref);
|
database.addNotificationToDatabase(ref);
|
||||||
}
|
}
|
||||||
if (watchState.isFriendsLoaded && state.notificationInitStatus) {
|
if (watchState.isFriendsLoaded && state.notificationInitStatus) {
|
||||||
|
if (
|
||||||
|
ref.details?.worldId &&
|
||||||
|
!instanceStore.cachedInstances.has(ref.details.worldId)
|
||||||
|
) {
|
||||||
|
// get instance name for invite
|
||||||
|
const L = parseLocation(ref.details.worldId);
|
||||||
|
if (L.isRealInstance) {
|
||||||
|
instanceRequest.getInstance({
|
||||||
|
worldId: L.worldId,
|
||||||
|
instanceId: L.tag
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
state.notificationTable.filters[0].value.length === 0 ||
|
state.notificationTable.filters[0].value.length === 0 ||
|
||||||
state.notificationTable.filters[0].value.includes(ref.type)
|
state.notificationTable.filters[0].value.includes(ref.type)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
|
|||||||
|
|
||||||
const lastStatusText = ref('');
|
const lastStatusText = ref('');
|
||||||
const statusText = computed(() => {
|
const statusText = computed(() => {
|
||||||
if (lastStatusSummary.value) {
|
if (lastStatus.value && lastStatusSummary.value) {
|
||||||
return `${lastStatus.value}: ${lastStatusSummary.value}`;
|
return `${lastStatus.value}: ${lastStatusSummary.value}`;
|
||||||
}
|
}
|
||||||
return lastStatus.value;
|
return lastStatus.value;
|
||||||
@@ -38,9 +38,6 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
|
|||||||
showClose: true,
|
showClose: true,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
openStatusPage();
|
openStatusPage();
|
||||||
},
|
|
||||||
onClose: () => {
|
|
||||||
alertRef.value = null;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -56,9 +53,6 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
|
|||||||
showClose: true,
|
showClose: true,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
openStatusPage();
|
openStatusPage();
|
||||||
},
|
|
||||||
onClose: () => {
|
|
||||||
alertRef.value = null;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user