mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix: update the profile picture in the navigation-bar (#12723)
* fix: update the profile picture in the navigation-bar * chore: clean up --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
parent
b0aafce16b
commit
c468da589a
23 changed files with 147 additions and 36 deletions
|
|
@ -56,13 +56,14 @@
|
|||
return;
|
||||
}
|
||||
const file = new File([blob], 'profile-picture.png', { type: 'image/png' });
|
||||
const { profileImagePath } = await createProfileImage({ createProfileImageDto: { file } });
|
||||
const { profileImagePath, profileChangedAt } = await createProfileImage({ createProfileImageDto: { file } });
|
||||
notificationController.show({
|
||||
type: NotificationType.Info,
|
||||
message: $t('profile_picture_set'),
|
||||
timeout: 3000,
|
||||
});
|
||||
$user.profileImagePath = profileImagePath;
|
||||
$user.profileChangedAt = profileChangedAt;
|
||||
} catch (error) {
|
||||
handleError(error, $t('errors.unable_to_set_profile_picture'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
email: string;
|
||||
profileImagePath: string;
|
||||
avatarColor: UserAvatarColor;
|
||||
profileChangedAt: string;
|
||||
}
|
||||
|
||||
export let user: User;
|
||||
|
|
@ -79,7 +80,7 @@
|
|||
{#if showProfileImage && user.profileImagePath}
|
||||
<img
|
||||
bind:this={img}
|
||||
src={getProfileImageUrl(user.id)}
|
||||
src={getProfileImageUrl(user)}
|
||||
alt={$t('profile_image_of_user', { values: { user: title } })}
|
||||
class="h-full w-full object-cover"
|
||||
class:hidden={showFallback}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue