Apply suggestions from code review
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
e88edba650
commit
00d5a0baa4
4 changed files with 12 additions and 13 deletions
|
@ -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>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue