Prevent the sidebar instance group title being shown as "Traveling"

This commit is contained in:
Natsumi
2025-01-27 12:12:31 +13:00
parent 72bb8c7cc0
commit ca6b52c053
2 changed files with 13 additions and 3 deletions

View File

@@ -23331,8 +23331,18 @@ console.log(`isLinux: ${LINUX}`);
$app.methods.getFriendsLocations = function (friendsArr) {
// prevent the instance title display as "Traveling".
return friendsArr.find((friend) => !friend.ref?.$location?.isTraveling)
?.ref?.location;
if (!friendsArr?.length) {
return '';
}
for (const friend of friendsArr) {
if (friend.ref?.location !== 'traveling') {
return friend.ref.location;
}
if ($utils.isRealInstance(friend.ref?.travelingToLocation)) {
return friend.ref.travelingToLocation;
}
}
return friendsArr[0].ref?.location;
};
// #endregion