mirror of
https://github.com/open-webui/open-webui
synced 2025-04-16 13:39:39 +00:00
fix: account page issue
This commit is contained in:
parent
0f12c4d14f
commit
610f9d039a
@ -114,7 +114,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</Menu>
|
</Menu>
|
||||||
{:else if $mobile && ($user.role === 'admin' || $user?.permissions.chat?.controls)}
|
{:else if $mobile && ($user.role === 'admin' || $user?.permissions?.chat?.controls)}
|
||||||
<Tooltip content={$i18n.t('Controls')}>
|
<Tooltip content={$i18n.t('Controls')}>
|
||||||
<button
|
<button
|
||||||
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
||||||
@ -130,7 +130,7 @@
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if !$mobile && ($user.role === 'admin' || $user?.permissions.chat?.controls)}
|
{#if !$mobile && ($user.role === 'admin' || $user?.permissions?.chat?.controls)}
|
||||||
<Tooltip content={$i18n.t('Controls')}>
|
<Tooltip content={$i18n.t('Controls')}>
|
||||||
<button
|
<button
|
||||||
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import { onMount, getContext } from 'svelte';
|
import { onMount, getContext } from 'svelte';
|
||||||
|
|
||||||
import { user, config, settings } from '$lib/stores';
|
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 UpdatePassword from './Account/UpdatePassword.svelte';
|
||||||
import { getGravatarUrl } from '$lib/apis/utils';
|
import { getGravatarUrl } from '$lib/apis/utils';
|
||||||
@ -53,7 +53,13 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (updatedUser) {
|
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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user