mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 12:55:19 +00:00
update initals avatar if user changes name
This commit is contained in:
parent
40e1e212d4
commit
a0a064f4c8
1 changed files with 5 additions and 0 deletions
|
|
@ -39,6 +39,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const submitHandler = async () => {
|
const submitHandler = async () => {
|
||||||
|
const isInitialsImage: boolean = profileImageUrl === generateInitialsImage($user.name) || profileImageUrl === '';
|
||||||
|
if (isInitialsImage && name !== $user.name) {
|
||||||
|
profileImageUrl = generateInitialsImage(name);
|
||||||
|
}
|
||||||
|
|
||||||
const updatedUser = await updateUserProfile(localStorage.token, name, profileImageUrl).catch(
|
const updatedUser = await updateUserProfile(localStorage.token, name, profileImageUrl).catch(
|
||||||
(error) => {
|
(error) => {
|
||||||
toast.error(error);
|
toast.error(error);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue