fix: account page issue

This commit is contained in:
Timothy Jaeryang Baek committed 2025-02-10 13:00:44 -08:00
1 parent 0f12c4d14f
commit 610f9d039a
2 files changed
+10 -4

No files matched your search

@@ -3,7 +3,7 @@
import { onMount, getContext } from 'svelte';
import { user, config, settings } from '$lib/stores';
import { updateUserProfile, createAPIKey, getAPIKey } from '$lib/apis/auths';
import { updateUserProfile, createAPIKey, getAPIKey, getSessionUser } from '$lib/apis/auths';
import UpdatePassword from './Account/UpdatePassword.svelte';
import { getGravatarUrl } from '$lib/apis/utils';
@@ -53,7 +53,13 @@
);
if (updatedUser) {
await user.set(updatedUser);
// Get Session User Info
const sessionUser = await getSessionUser(localStorage.token).catch((error) => {
toast.error(`${error}`);
return null;
});
await user.set(sessionUser);
return true;
}
return false;