From 5be7b753ff1542b2c59110e268138b5b8ef6f877 Mon Sep 17 00:00:00 2001 From: martin <74269598+martabal@users.noreply.github.com> Date: Sun, 11 Feb 2024 19:10:41 +0100 Subject: [PATCH] fix(web): update profile picture (#7034) fix: update profile picture --- .../components/shared-components/profile-image-cropper.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/lib/components/shared-components/profile-image-cropper.svelte b/web/src/lib/components/shared-components/profile-image-cropper.svelte index 6f71898311..81011486a7 100644 --- a/web/src/lib/components/shared-components/profile-image-cropper.svelte +++ b/web/src/lib/components/shared-components/profile-image-cropper.svelte @@ -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.'); }