1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

fix(web): update profile picture (#7034)

fix: update profile picture
This commit is contained in:
martin 2024-02-11 19:10:41 +01:00 committed by GitHub
parent eeeabcfef4
commit 5be7b753ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@
import PhotoViewer from '../asset-viewer/photo-viewer.svelte';
import BaseModal from './base-modal.svelte';
import Button from '../elements/buttons/button.svelte';
import { user } from '$lib/stores/user.store';
export let asset: AssetResponseDto;
@ -56,12 +57,13 @@
return;
}
const file = new File([blob], 'profile-picture.png', { type: 'image/png' });
await api.userApi.createProfileImage({ file });
const { data } = await api.userApi.createProfileImage({ file });
notificationController.show({
type: NotificationType.Info,
message: 'Profile picture set.',
timeout: 3000,
});
$user.profileImagePath = data.profileImagePath;
} catch (error) {
handleError(error, 'Error setting profile picture.');
}