mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
parent
eeeabcfef4
commit
5be7b753ff
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
import PhotoViewer from '../asset-viewer/photo-viewer.svelte';
|
import PhotoViewer from '../asset-viewer/photo-viewer.svelte';
|
||||||
import BaseModal from './base-modal.svelte';
|
import BaseModal from './base-modal.svelte';
|
||||||
import Button from '../elements/buttons/button.svelte';
|
import Button from '../elements/buttons/button.svelte';
|
||||||
|
import { user } from '$lib/stores/user.store';
|
||||||
|
|
||||||
export let asset: AssetResponseDto;
|
export let asset: AssetResponseDto;
|
||||||
|
|
||||||
|
@ -56,12 +57,13 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const file = new File([blob], 'profile-picture.png', { type: 'image/png' });
|
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({
|
notificationController.show({
|
||||||
type: NotificationType.Info,
|
type: NotificationType.Info,
|
||||||
message: 'Profile picture set.',
|
message: 'Profile picture set.',
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
});
|
});
|
||||||
|
$user.profileImagePath = data.profileImagePath;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, 'Error setting profile picture.');
|
handleError(error, 'Error setting profile picture.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue