mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 14:46:04 +02:00
Change instance fetching
This commit is contained in:
+10
-16
@@ -25,7 +25,6 @@
|
|||||||
import { ref, watchEffect } from 'vue';
|
import { ref, watchEffect } from 'vue';
|
||||||
import { getGroupName, getWorldName, parseLocation } from '../shared/utils';
|
import { getGroupName, getWorldName, parseLocation } from '../shared/utils';
|
||||||
import { useGroupStore, useInstanceStore, useSearchStore, useWorldStore } from '../stores';
|
import { useGroupStore, useInstanceStore, useSearchStore, useWorldStore } from '../stores';
|
||||||
import { instanceRequest } from '../api';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
@@ -33,6 +32,7 @@
|
|||||||
const { showGroupDialog } = useGroupStore();
|
const { showGroupDialog } = useGroupStore();
|
||||||
const { showPreviousInstancesInfoDialog } = useInstanceStore();
|
const { showPreviousInstancesInfoDialog } = useInstanceStore();
|
||||||
const { verifyShortName } = useSearchStore();
|
const { verifyShortName } = useSearchStore();
|
||||||
|
const { cachedInstances } = useInstanceStore();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
location: String,
|
location: String,
|
||||||
@@ -89,21 +89,15 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
instanceRequest
|
const instanceRef = cachedInstances.get(L.tag);
|
||||||
.getCachedInstance({ worldId: L.worldId, instanceId: L.instanceId })
|
if (typeof instanceRef !== 'undefined') {
|
||||||
.then((args) => {
|
if (instanceRef.displayName) {
|
||||||
if (currentInstanceId() === L.tag) {
|
setText(L, instanceRef.displayName);
|
||||||
if (args.json.displayName) {
|
}
|
||||||
setText(L, args.json.displayName);
|
if (instanceRef.closedAt) {
|
||||||
}
|
isClosed.value = true;
|
||||||
if (args.json.closedAt) {
|
}
|
||||||
isClosed.value = true;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
console.error(e);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (props.grouphint) {
|
if (props.grouphint) {
|
||||||
groupName.value = props.grouphint;
|
groupName.value = props.grouphint;
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
import { Lock, Unlock, WarnTriangleFilled } from '@element-plus/icons-vue';
|
import { Lock, Unlock, WarnTriangleFilled } from '@element-plus/icons-vue';
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { getGroupName, parseLocation } from '../shared/utils';
|
import { getGroupName, parseLocation } from '../shared/utils';
|
||||||
import { useGroupStore, useLaunchStore } from '../stores';
|
import { useGroupStore, useLaunchStore, useInstanceStore } from '../stores';
|
||||||
import { instanceRequest } from '../api';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { cachedInstances } = useInstanceStore();
|
||||||
|
|
||||||
const launchStore = useLaunchStore();
|
const launchStore = useLaunchStore();
|
||||||
const groupStore = useGroupStore();
|
const groupStore = useGroupStore();
|
||||||
@@ -65,21 +65,15 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
instanceRequest
|
const instanceRef = cachedInstances.get(L.tag);
|
||||||
.getCachedInstance({ worldId: L.worldId, instanceId: L.instanceId })
|
if (typeof instanceRef !== 'undefined') {
|
||||||
.then((args) => {
|
if (instanceRef.displayName) {
|
||||||
if (locObj.tag === L.tag) {
|
instanceName.value = instanceRef.displayName;
|
||||||
if (args.json.displayName) {
|
}
|
||||||
instanceName.value = args.json.displayName;
|
if (instanceRef.closedAt) {
|
||||||
}
|
isClosed.value = true;
|
||||||
if (args.json.closedAt) {
|
}
|
||||||
isClosed.value = true;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
console.error(e);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (props.grouphint) {
|
if (props.grouphint) {
|
||||||
groupName.value = props.grouphint;
|
groupName.value = props.grouphint;
|
||||||
|
|||||||
@@ -646,6 +646,15 @@ export const useUserStore = defineStore('User', () => {
|
|||||||
sharedFeedStore.updateSharedFeed(false);
|
sharedFeedStore.updateSharedFeed(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
!instanceStore.cachedInstances.has(ref.$location.tag) &&
|
||||||
|
isRealInstance(ref.location)
|
||||||
|
) {
|
||||||
|
instanceRequest.getInstance({
|
||||||
|
worldId: ref.$location.worldId,
|
||||||
|
instanceId: ref.$location.instanceId
|
||||||
|
});
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
ref.$isVRCPlus &&
|
ref.$isVRCPlus &&
|
||||||
ref.badges &&
|
ref.badges &&
|
||||||
|
|||||||
Reference in New Issue
Block a user