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 608d5bdc00..09d4b63af3 100644 --- a/web/src/lib/components/shared-components/profile-image-cropper.svelte +++ b/web/src/lib/components/shared-components/profile-image-cropper.svelte @@ -12,7 +12,7 @@ import domtoimage from 'dom-to-image'; import type { UserResponseDto } from '@api'; import { notificationController, NotificationType } from './notification/notification'; - import { isUpdateProfilePicture } from '$lib/stores/preferences.store'; + import { lastUpdatedProfilePicture } from '$lib/stores/preferences.store'; onMount(() => { console.log(asset); }); @@ -27,14 +27,16 @@ domtoimage.toBlob(div).then(function (blob: Blob) { const file: File = new File([blob], 'profile-picture.png', { type: 'image/png' }); try { - api.userApi.createProfileImage({ file }); - //set store to update profile picture - isUpdateProfilePicture.set(true); - dispatch('close'); - notificationController.show({ - type: NotificationType.Info, - message: 'Profile picture set.', - timeout: 3000, + api.userApi.createProfileImage({ file }).then((res) => { + console.log(res); + //set store to update profile picture + lastUpdatedProfilePicture.set(Date.now()); + dispatch('close'); + notificationController.show({ + type: NotificationType.Info, + message: 'Profile picture set.', + timeout: 3000, + }); }); } catch (err) { console.error('Error [profile-image-cropper]:', err); diff --git a/web/src/lib/components/shared-components/user-avatar.svelte b/web/src/lib/components/shared-components/user-avatar.svelte index a9ab500a96..7a91aef467 100644 --- a/web/src/lib/components/shared-components/user-avatar.svelte +++ b/web/src/lib/components/shared-components/user-avatar.svelte @@ -6,6 +6,7 @@