Apply suggestions from code review

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Jaiwanth 2021-08-13 08:59:28 +05:30 committed by GitHub
parent e88edba650
commit 00d5a0baa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 13 deletions

View file

@ -32,9 +32,9 @@ type BlobFile = {
};
export default abstract class Exporter {
protected files: BlobFile[];
protected files: BlobFile[] = [];
protected client: MatrixClient;
protected cancelled: boolean;
protected cancelled = false;
protected constructor(
protected room: Room,
@ -47,8 +47,6 @@ export default abstract class Exporter {
exportOptions.numberOfMessages > 10**8) {
throw new Error("Invalid export options");
}
this.cancelled = false;
this.files = [];
this.client = MatrixClientPeg.get();
window.addEventListener("beforeunload", this.onBeforeUnload);
}
@ -71,7 +69,7 @@ export default abstract class Exporter {
this.files.push(file);
}
protected async downloadZIP(): Promise<any> {
protected async downloadZIP(): Promise<void> {
const filename = `matrix-export-${formatFullDateNoDay(new Date())}.zip`;
const zip = new JSZip();
@ -257,5 +255,5 @@ export default abstract class Exporter {
return mxEv.getType() === attachmentTypes[0] || attachmentTypes.includes(mxEv.getContent().msgtype);
}
abstract export(): Promise<any>;
abstract export(): Promise<void>;
}