Apply prettier formatting

This commit is contained in:
Michael Weimann 2022-12-12 12:24:14 +01:00
parent 1cac306093
commit 526645c791
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
1576 changed files with 65385 additions and 62478 deletions

View file

@ -25,7 +25,12 @@ import SettingsStore from "../../../../../settings/SettingsStore";
import EditorStateTransfer from "../../../../../utils/EditorStateTransfer";
function getFormattedContent(editorStateTransfer: EditorStateTransfer): string {
return editorStateTransfer.getEvent().getContent().formatted_body?.replace(/<mx-reply>.*<\/mx-reply>/, '') || '';
return (
editorStateTransfer
.getEvent()
.getContent()
.formatted_body?.replace(/<mx-reply>.*<\/mx-reply>/, "") || ""
);
}
function parseEditorStateTransfer(
@ -39,13 +44,13 @@ function parseEditorStateTransfer(
if (editorStateTransfer.hasEditorState()) {
// if restoring state from a previous editor,
// restore serialized parts from the state
parts = editorStateTransfer.getSerializedParts().map(p => partCreator.deserializePart(p));
parts = editorStateTransfer.getSerializedParts().map((p) => partCreator.deserializePart(p));
} else {
// otherwise, either restore serialized parts from localStorage or parse the body of the event
// TODO local storage
// const restoredParts = this.restoreStoredEditorState(partCreator);
if (editorStateTransfer.getEvent().getContent().format === 'org.matrix.custom.html') {
if (editorStateTransfer.getEvent().getContent().format === "org.matrix.custom.html") {
return getFormattedContent(editorStateTransfer);
}
@ -54,7 +59,7 @@ function parseEditorStateTransfer(
});
}
return parts.reduce((content, part) => content + part.text, '');
return parts.reduce((content, part) => content + part.text, "");
// Todo local storage
// this.saveStoredEditorState();
}