Fix user profile badges and random errors

This commit is contained in:
Natsumi
2025-10-18 22:41:13 +11:00
parent 71d4e57900
commit 893302f0ad
9 changed files with 30 additions and 16 deletions
+10 -1
View File
@@ -119,15 +119,24 @@ export const useAuthStore = defineStore('Auth', () => {
loginForm.value.lastUserLoggedIn = lastUserLoggedIn;
try {
const credentials = JSON.parse(savedCredentials || '{}');
// fix goofy typo
let edited = false;
for (const userId in credentials) {
// fix goofy typo
if (credentials[userId].loginParmas) {
credentials[userId].loginParams =
credentials[userId].loginParmas;
delete credentials[userId].loginParmas;
edited = true;
}
// fix missing fields
if (!credentials[userId].loginParams.endpoint) {
credentials[userId].loginParams.endpoint = '';
edited = true;
}
if (!credentials[userId].loginParams.websocket) {
credentials[userId].loginParams.websocket = '';
edited = true;
}
}
if (edited) {
await configRepository.setString(
+4 -1
View File
@@ -597,7 +597,10 @@ export const useGameLogStore = defineStore('GameLog', () => {
console.error('Missing userId:', gameLog.displayName);
} else if (userId === userStore.currentUser.id) {
// skip
} else if (friendStore.friends.has(userId)) {
} else if (
friendStore.friends.has(userId) &&
typeof ref !== 'undefined'
) {
locationStore.lastLocation.friendList.set(userId, userMap);
if (
ref.location !== locationStore.lastLocation.location &&
+1 -1
View File
@@ -364,7 +364,7 @@ export const useInstanceStore = defineStore('Instance', () => {
}
if (
userStore.userDialog.visible &&
userStore.userDialog.ref.$location.tag === ref.id
userStore.userDialog.ref?.$location.tag === ref.id
) {
userStore.applyUserDialogLocation();
}
+2 -2
View File
@@ -561,7 +561,7 @@ export const useUserStore = defineStore('User', () => {
}
}
for (const prop in json) {
if (typeof ref[prop] !== 'undefined') {
if (typeof json[prop] !== 'undefined') {
ref[prop] = json[prop];
}
}
@@ -1732,7 +1732,7 @@ export const useUserStore = defineStore('User', () => {
}
}
for (const prop in json) {
if (typeof ref[prop] !== 'undefined') {
if (typeof json[prop] !== 'undefined') {
ref[prop] = json[prop];
}
}