From 4763702bd368bbffd4f5369c0ad47d3962c90a40 Mon Sep 17 00:00:00 2001 From: Kshitij Sobti Date: Fri, 3 Dec 2021 18:28:37 +0530 Subject: [PATCH] fix: fix autosaving --- src/components/TinyMCEEditor.jsx | 1 - src/discussions/comments/comment/CommentEditor.jsx | 4 ++++ src/discussions/posts/post-editor/PostEditor.jsx | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/TinyMCEEditor.jsx b/src/components/TinyMCEEditor.jsx index 1b5ab655..27607ce9 100644 --- a/src/components/TinyMCEEditor.jsx +++ b/src/components/TinyMCEEditor.jsx @@ -82,7 +82,6 @@ export default function TinyMCEEditor(props) { a11y_advanced_options: true, autosave_interval: '1s', autosave_restore_when_empty: true, - autosave_prefix: 'tinymce-autosave-{path}{query}', plugins: 'autosave codesample link lists image imagetools code', toolbar: 'formatselect | bold italic underline' + ' | link blockquote openedx_code image' diff --git a/src/discussions/comments/comment/CommentEditor.jsx b/src/discussions/comments/comment/CommentEditor.jsx index 4cc44f64..ec21a794 100644 --- a/src/discussions/comments/comment/CommentEditor.jsx +++ b/src/discussions/comments/comment/CommentEditor.jsx @@ -27,6 +27,9 @@ function CommentEditor({ } onCloseEditor(); }; + // The editorId is used to autosave contents to localstorage. This format means that the autosave is scoped to + // the current comment id, or the current comment parent or the curren thread. + const editorId = `comment-editor-${comment.id || comment.parentId || comment.threadId}`; return (