diff --git a/src/lib/components/chat/Settings/Account.svelte b/src/lib/components/chat/Settings/Account.svelte index ba33056ec..36d2d6320 100644 --- a/src/lib/components/chat/Settings/Account.svelte +++ b/src/lib/components/chat/Settings/Account.svelte @@ -39,6 +39,11 @@ }; 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( (error) => { toast.error(error);