diff --git a/app/editor/index.tsx b/app/editor/index.tsx index 4af42b285..69d4bfe8a 100644 --- a/app/editor/index.tsx +++ b/app/editor/index.tsx @@ -118,7 +118,7 @@ export type Props = { /** Callback when user uses cancel key combo */ onCancel?: () => void; /** Callback when user changes editor content */ - onChange?: (value: () => string) => void; + onChange?: (value: () => string | undefined) => void; /** Callback when a file upload begins */ onFileUploadStart?: () => void; /** Callback when a file upload ends */ @@ -629,7 +629,7 @@ export class Editor extends React.PureComponent< } this.props.onChange(() => { - return this.value(); + return this.view ? this.value() : undefined; }); }; diff --git a/app/scenes/Document/components/DataLoader.tsx b/app/scenes/Document/components/DataLoader.tsx index c8a3792c5..9f9d6c6da 100644 --- a/app/scenes/Document/components/DataLoader.tsx +++ b/app/scenes/Document/components/DataLoader.tsx @@ -272,7 +272,11 @@ class DataLoader extends React.Component { revision, abilities, isEditing: this.isEditing, - readOnly: !this.isEditing || !abilities.update || document.isArchived, + readOnly: + !this.isEditing || + !abilities.update || + document.isArchived || + !!revisionId, onSearchLink: this.onSearchLink, onCreateLink: this.onCreateLink, sharedTree: this.sharedTree,