Skip to content

Commit 19bbdfc

Browse files
committed
Finally fixes velopert#52
1 parent 0989329 commit 19bbdfc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/components/write/WriteMarkdownEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ export default class WriteMarkdownEditor extends React.Component<
367367
const { lastUploadedImage, initialBody } = this.props;
368368
if (initialBody !== prevProps.initialBody) {
369369
if (!this.codemirror) return;
370+
if (this.codemirror.getValue() === this.props.initialBody) return;
370371
this.codemirror.setValue(this.props.initialBody);
371372
}
372373
if (

src/containers/write/MarkdownEditorContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
249249
}
250250
}, [title, postId, onTempSave, lastSavedData, markdown]);
251251

252-
useSaveHotKey(onTempSave);
252+
useSaveHotKey(() => onTempSave(true));
253253

254254
return (
255255
<>

0 commit comments

Comments
 (0)