Small fixes

This commit is contained in:
Natsumi
2025-11-09 20:48:42 +11:00
parent ddb62d7a31
commit 9069d8cefe
6 changed files with 36 additions and 16 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ const startup = args.includes('--startup');
const noUpdater = const noUpdater =
args.includes('--no-updater') || args.includes('--no-updater') ||
fs.existsSync(path.join(rootDir, '.no-updater')); fs.existsSync(path.join(rootDir, '.no-updater'));
if (process.defaultApp) { if (process.defaultApp && process.platform !== 'win32') {
if (process.argv.length >= 2) { if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient(VRCX_URI_PREFIX, process.execPath, [ app.setAsDefaultProtocolClient(VRCX_URI_PREFIX, process.execPath, [
path.resolve(process.argv[1]) path.resolve(process.argv[1])
+3 -3
View File
@@ -145,7 +145,7 @@ function parseLocation(tag) {
} }
function getFriendsLocations(friendsArr) { function getFriendsLocations(friendsArr) {
const locaationStore = useLocationStore(); const locationStore = useLocationStore();
// prevent the instance title display as "Traveling". // prevent the instance title display as "Traveling".
if (!friendsArr?.length) { if (!friendsArr?.length) {
return ''; return '';
@@ -161,8 +161,8 @@ function getFriendsLocations(friendsArr) {
} }
} }
for (const friend of friendsArr) { for (const friend of friendsArr) {
if (locaationStore.lastLocation.friendList.has(friend.id)) { if (locationStore.lastLocation.friendList.has(friend.id)) {
return locaationStore.lastLocation.location; return locationStore.lastLocation.location;
} }
} }
return friendsArr[0].ref?.location; return friendsArr[0].ref?.location;
+11 -9
View File
@@ -273,16 +273,18 @@ export const useGroupStore = defineStore('Group', () => {
groupChange(ref, `Role ${roleName} removed`); groupChange(ref, `Role ${roleName} removed`);
} }
} }
for (const roleId of newRoleIds) { if (typeof newRoles !== 'undefined') {
if (!oldRoleIds.includes(roleId)) { for (const roleId of newRoleIds) {
let roleName = ''; if (!oldRoleIds.includes(roleId)) {
const role = newRoles.find( let roleName = '';
(fineRole) => fineRole.id === roleId const role = newRoles.find(
); (fineRole) => fineRole.id === roleId
if (role) { );
roleName = role.name; if (role) {
roleName = role.name;
}
groupChange(ref, `Role ${roleName} added`);
} }
groupChange(ref, `Role ${roleName} added`);
} }
} }
} }
+9 -2
View File
@@ -266,7 +266,10 @@ export const useSearchStore = defineStore('Search', () => {
) { ) {
userStore.showUserDialog(input); userStore.showUserDialog(input);
return true; return true;
} else if (input.substring(0, 5) === 'avtr_') { } else if (
input.substring(0, 5) === 'avtr_' ||
input.substring(0, 2) === 'b_'
) {
avatarStore.showAvatarDialog(input); avatarStore.showAvatarDialog(input);
return true; return true;
} else if (input.substring(0, 4) === 'grp_') { } else if (input.substring(0, 4) === 'grp_') {
@@ -316,7 +319,11 @@ export const useSearchStore = defineStore('Search', () => {
return true; return true;
} }
} }
} else if (input.substring(0, 5) === 'wrld_') { } else if (
input.substring(0, 5) === 'wrld_' ||
input.substring(0, 4) === 'wld_' ||
input.substring(0, 2) === 'o_'
) {
// a bit hacky, but supports weird malformed inputs cut out from url, why not // a bit hacky, but supports weird malformed inputs cut out from url, why not
if (input.indexOf('&instanceId=') >= 0) { if (input.indexOf('&instanceId=') >= 0) {
input = `https://vrchat.com/home/launch?worldId=${input}`; input = `https://vrchat.com/home/launch?worldId=${input}`;
+6 -1
View File
@@ -565,7 +565,12 @@ export const useVrcxStore = defineStore('Vrcx', () => {
let shouldFocusWindow = true; let shouldFocusWindow = true;
switch (command) { switch (command) {
case 'world': case 'world':
searchStore.directAccessWorld(input.replace('world/', '')); if (
!searchStore.directAccessWorld(input.replace('world/', ''))
) {
// fallback for mangled world ids
worldStore.showWorldDialog(commandArg);
}
break; break;
case 'avatar': case 'avatar':
avatarStore.showAvatarDialog(commandArg); avatarStore.showAvatarDialog(commandArg);
+6
View File
@@ -204,6 +204,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
} }
}); });
json = JSON.parse(response.data); json = JSON.parse(response.data);
} catch (error) {
console.error('Failed to check for VRCX update', error);
return;
} finally { } finally {
checkingForVRCXUpdate.value = false; checkingForVRCXUpdate.value = false;
} }
@@ -280,6 +283,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
} }
}); });
json = JSON.parse(response.data); json = JSON.parse(response.data);
} catch (error) {
console.error('Failed to check for VRCX update', error);
return;
} finally { } finally {
checkingForVRCXUpdate.value = false; checkingForVRCXUpdate.value = false;
} }