show error in label for now

This commit is contained in:
Bruno Windels 2020-10-29 10:18:05 +01:00
parent 0405af0116
commit d1e78a735a

View File

@ -1,5 +1,6 @@
/*
Copyright 2020 Bruno Windels <bruno@windels.cloud>
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -49,6 +50,7 @@ export class ImageTile extends MessageTile {
}
} catch (err) {
this._error = err;
this.emitChange("label");
}
}
@ -95,6 +97,9 @@ export class ImageTile extends MessageTile {
}
get label() {
if (this._error) {
return `Could not decrypt image: ${this._error.message}`;
}
return this._getContent().body;
}