refactor queryRequest

This commit is contained in:
pa
2026-03-09 21:28:45 +09:00
parent c1a35223d4
commit 58b9bdc1c5
60 changed files with 1134 additions and 883 deletions

View File

@@ -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);