mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
store error when loading encrypted images
This commit is contained in:
parent
e7ff6decbf
commit
97c3a4b8f3
@ -24,6 +24,7 @@ export class ImageTile extends MessageTile {
|
|||||||
super(options);
|
super(options);
|
||||||
this._decryptedThumbail = null;
|
this._decryptedThumbail = null;
|
||||||
this._decryptedImage = null;
|
this._decryptedImage = null;
|
||||||
|
this._error = null;
|
||||||
this.load();
|
this.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,6 +37,7 @@ export class ImageTile extends MessageTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async load() {
|
async load() {
|
||||||
|
try {
|
||||||
const thumbnailFile = this._getContent().info?.thumbnail_file;
|
const thumbnailFile = this._getContent().info?.thumbnail_file;
|
||||||
const file = this._getContent().file;
|
const file = this._getContent().file;
|
||||||
if (thumbnailFile) {
|
if (thumbnailFile) {
|
||||||
@ -45,6 +47,9 @@ export class ImageTile extends MessageTile {
|
|||||||
this._decryptedImage = await this._loadEncryptedFile(file);
|
this._decryptedImage = await this._loadEncryptedFile(file);
|
||||||
this.emitChange("thumbnailUrl");
|
this.emitChange("thumbnailUrl");
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
this._error = err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get thumbnailUrl() {
|
get thumbnailUrl() {
|
||||||
|
Loading…
Reference in New Issue
Block a user