Handle export cancellation
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user