mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
clean up properly
This commit is contained in:
parent
d14f485292
commit
c65e8bea11
@ -12,6 +12,7 @@
|
||||
link.href = url;
|
||||
link.download = filename;
|
||||
link.click();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data.type === "download") {
|
||||
|
@ -33,12 +33,14 @@ export class FileTile extends MessageTile {
|
||||
const filename = content.body;
|
||||
this._downloading = true;
|
||||
this.emitChange("label");
|
||||
let bufferHandle;
|
||||
try {
|
||||
const bufferHandle = await this._mediaRepository.downloadAttachment(content);
|
||||
bufferHandle = await this._mediaRepository.downloadAttachment(content);
|
||||
this.platform.offerSaveBufferHandle(bufferHandle, filename);
|
||||
} catch (err) {
|
||||
this._error = err;
|
||||
} finally {
|
||||
bufferHandle?.dispose();
|
||||
this._downloading = false;
|
||||
}
|
||||
this.emitChange("label");
|
||||
|
Loading…
Reference in New Issue
Block a user