Fix the portrait not being up-to-date after login in.

This commit is contained in:
2024-09-04 22:05:49 -04:00
parent b14a775040
commit caf1c6336b

View File

@@ -66,6 +66,10 @@ export const useUserStore = defineStore(
try {
const userResponse = await client.get("/api/users/profile");
user.value = userResponse.data
// Cache-busting only if portraitUrl exists
if (user.value.portraitUrl) {
user.value.portraitUrl = `${user.value.portraitUrl}?${Date.now()}`;
}
} catch (error) {
user.value = undefined;
}
@@ -189,7 +193,6 @@ export const useUserStore = defineStore(
changeEmail,
changeAddress,
changePortrait,
fetchCurrentUserProfile,
fetchCurrentCreatorProfile
}
})