Skip to content

Commit

Permalink
fix(web): update profile picture (#7034)
Browse files Browse the repository at this point in the history
fix: update profile picture
  • Loading branch information
martabal authored Feb 11, 2024
1 parent eeeabcf commit 5be7b75
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.');
}
Expand Down

0 comments on commit 5be7b75

Please sign in to comment.