Handle errors when loading group pictures
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
c0ef41cb71
commit
7e7eed290f
|
@ -259,17 +259,22 @@ 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> {
|
||||||
if (
|
try {
|
||||||
oldGroup?.avatar !== undefined &&
|
if (
|
||||||
oldGroup?.avatar !== newGroup?.avatar
|
oldGroup?.avatar !== undefined &&
|
||||||
) {
|
oldGroup?.avatar !== newGroup?.avatar
|
||||||
this.avatarFile = await buildFileFromIMedia(this.group.avatar);
|
) {
|
||||||
}
|
this.avatarFile = await buildFileFromIMedia(this.group.avatar);
|
||||||
if (
|
}
|
||||||
oldGroup?.banner !== undefined &&
|
if (
|
||||||
oldGroup?.banner !== newGroup?.banner
|
oldGroup?.banner !== undefined &&
|
||||||
) {
|
oldGroup?.banner !== newGroup?.banner
|
||||||
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 };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue