Handle export cancellation

This commit is contained in:
Jaiwanth
2021-06-27 20:55:54 +05:30
parent 398d49245f
commit d46fe678b0
6 changed files with 107 additions and 54 deletions
-24
View File
@@ -1,8 +1,4 @@
import { Room } from "matrix-js-sdk/src/models/room";
import { _t } from "../../languageHandler";
import HTMLExporter from "./HtmlExport";
import JSONExporter from "./JSONExport";
import PlainTextExporter from "./PlainTextExport";
export enum exportFormats {
HTML = "HTML",
@@ -48,23 +44,3 @@ export interface exportOptions {
maxSize: number;
}
const exportConversationalHistory = async (
room: Room,
format: string,
exportType: exportTypes,
exportOptions?: exportOptions,
) => {
switch (format) {
case exportFormats.HTML:
await new HTMLExporter(room, exportType, exportOptions).export();
break;
case exportFormats.JSON:
await new JSONExporter(room, exportType, exportOptions).export();
break;
case exportFormats.PLAIN_TEXT:
await new PlainTextExporter(room, exportType, exportOptions).export();
break;
}
};
export default exportConversationalHistory;