mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-29 03:33:47 +02:00
refactor queryRequest
This commit is contained in:
@@ -162,7 +162,7 @@
|
||||
useModalStore
|
||||
} from '../../stores';
|
||||
import { checkCanInvite, getLaunchURL, isRealInstance, parseLocation } from '../../shared/utils';
|
||||
import { instanceRequest, worldRequest } from '../../api';
|
||||
import { instanceRequest, queryRequest } from '../../api';
|
||||
|
||||
import InviteDialog from './InviteDialog/InviteDialog.vue';
|
||||
import configRepository from '../../service/config';
|
||||
@@ -230,16 +230,23 @@
|
||||
|
||||
getConfig();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function closeInviteDialog() {
|
||||
inviteDialog.value.visible = false;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param tag
|
||||
*/
|
||||
function showInviteDialog(tag) {
|
||||
if (!isRealInstance(tag)) {
|
||||
return;
|
||||
}
|
||||
const L = parseLocation(tag);
|
||||
worldRequest
|
||||
.getCachedWorld({
|
||||
queryRequest
|
||||
.fetch('world', {
|
||||
worldId: L.worldId
|
||||
})
|
||||
.then((args) => {
|
||||
@@ -259,6 +266,12 @@
|
||||
D.visible = true;
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param location
|
||||
* @param shortName
|
||||
* @param desktop
|
||||
*/
|
||||
function handleLaunchGame(location, shortName, desktop) {
|
||||
if (isGameRunning.value) {
|
||||
modalStore
|
||||
@@ -280,10 +293,21 @@
|
||||
isVisible.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param location
|
||||
* @param shortName
|
||||
*/
|
||||
function handleLaunchDefault(location, shortName) {
|
||||
handleLaunchGame(location, shortName, launchDialog.value.desktop);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param command
|
||||
* @param location
|
||||
* @param shortName
|
||||
*/
|
||||
function handleLaunchCommand(command, location, shortName) {
|
||||
const desktop = command === 'desktop';
|
||||
configRepository.setBool('launchAsDesktop', desktop);
|
||||
@@ -293,10 +317,20 @@
|
||||
launchDialog.value.desktop = desktop;
|
||||
}, 500);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param location
|
||||
* @param shortName
|
||||
*/
|
||||
function handleAttachGame(location, shortName) {
|
||||
tryOpenInstanceInVrc(location, shortName);
|
||||
isVisible.value = false;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param location
|
||||
* @param shortName
|
||||
*/
|
||||
function selfInvite(location, shortName) {
|
||||
const L = parseLocation(location);
|
||||
if (!L.isRealInstance) {
|
||||
@@ -314,9 +348,15 @@
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getConfig() {
|
||||
configRepository.getBool('launchAsDesktop').then((value) => (launchDialog.value.desktop = value));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async function initLaunchDialog() {
|
||||
const { tag, shortName } = launchDialogData.value;
|
||||
if (!isRealInstance(tag)) {
|
||||
@@ -361,6 +401,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param input
|
||||
*/
|
||||
async function copyInstanceMessage(input) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(input);
|
||||
|
||||
Reference in New Issue
Block a user