Support custom instance names

This commit is contained in:
Natsumi
2025-09-28 11:35:49 +13:00
parent 81a51ad2fa
commit da3c12c15b
10 changed files with 148 additions and 50 deletions

View File

@@ -416,6 +416,21 @@ export const useInstanceStore = defineStore('Instance', () => {
return ref;
}
async function getInstanceName(location) {
let instanceName = '';
const L = parseLocation(location);
if (L.isRealInstance && L.worldId && L.instanceId) {
const args = await instanceRequest.getCachedInstance({
worldId: L.worldId,
instanceId: L.instanceId
});
instanceName = args.ref.displayName;
}
return instanceName;
}
/**
*
* @param {string} worldId
@@ -1229,6 +1244,7 @@ export const useInstanceStore = defineStore('Instance', () => {
showPreviousInstancesInfoDialog,
addInstanceJoinHistory,
getCurrentInstanceUserList,
getInstanceJoinHistory
getInstanceJoinHistory,
getInstanceName
};
});