Handle errors when loading group pictures

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-04-01 12:08:53 +02:00
parent c0ef41cb71
commit 7e7eed290f
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -259,6 +259,7 @@ export default class GroupSettings extends mixins(GroupMixin) {
@Watch("group") @Watch("group")
async watchUpdateGroup(oldGroup: IGroup, newGroup: IGroup): Promise<void> { async watchUpdateGroup(oldGroup: IGroup, newGroup: IGroup): Promise<void> {
try {
if ( if (
oldGroup?.avatar !== undefined && oldGroup?.avatar !== undefined &&
oldGroup?.avatar !== newGroup?.avatar oldGroup?.avatar !== newGroup?.avatar
@ -271,6 +272,10 @@ export default class GroupSettings extends mixins(GroupMixin) {
) { ) {
this.bannerFile = await buildFileFromIMedia(this.group.banner); this.bannerFile = await buildFileFromIMedia(this.group.banner);
} }
} catch (e) {
// Catch errors while building media
console.error(e);
}
this.editableGroup = { ...this.group }; this.editableGroup = { ...this.group };
} }