refactor: dialogs (#1200)

This commit is contained in:
pa
2025-03-26 21:18:05 +09:00
committed by GitHub
parent c4bbb45403
commit 242bcfed22
31 changed files with 1694 additions and 1135 deletions

View File

@@ -76,7 +76,7 @@ export default class extends baseClass {
}
switch (L.accessType) {
case 'public':
L.joinUrl = this.getLaunchURL(L);
L.joinUrl = $utils.getLaunchURL(L);
L.accessName = `Public #${L.instanceName} (${platform})`;
break;
case 'invite+':

View File

@@ -424,5 +424,29 @@ export default {
}
// no match return origin url
return url;
},
replaceVrcPackageUrl(url) {
if (!url) {
return '';
}
return url.replace('https://api.vrchat.cloud/', 'https://vrchat.com/');
},
getLaunchURL(instance) {
var L = instance;
if (L.instanceId) {
if (L.shortName) {
return `https://vrchat.com/home/launch?worldId=${encodeURIComponent(
L.worldId
)}&instanceId=${encodeURIComponent(
L.instanceId
)}&shortName=${encodeURIComponent(L.shortName)}`;
}
return `https://vrchat.com/home/launch?worldId=${encodeURIComponent(
L.worldId
)}&instanceId=${encodeURIComponent(L.instanceId)}`;
}
return `https://vrchat.com/home/launch?worldId=${encodeURIComponent(
L.worldId
)}`;
}
};