fix: Disabling editor embeds should work with collaborative editing (#2968)

* fix: Disabling editor embeds should work with collaborative editing

* Design tweaks, fixed dragging
This commit is contained in:
Tom Moor
2022-01-28 18:27:27 -08:00
committed by GitHub
parent e7867e52e0
commit 1cd770e38d
11 changed files with 116 additions and 27 deletions

View File

@@ -392,7 +392,7 @@ class DocumentScene extends React.Component<Props> {
const team = auth.team;
const isShare = !!shareId;
const value = revision ? revision.text : document.text;
const disableEmbeds =
const embedsDisabled =
(team && team.documentEmbeds === false) || document.embedsDisabled;
const headings = this.editor.current
? // @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
@@ -570,7 +570,7 @@ class DocumentScene extends React.Component<Props> {
)}
<Editor
id={document.id}
key={disableEmbeds ? "disabled" : "enabled"}
key={embedsDisabled ? "disabled" : "enabled"}
innerRef={this.editor}
multiplayer={collaborativeEditing}
shareId={shareId}
@@ -580,7 +580,7 @@ class DocumentScene extends React.Component<Props> {
document={document}
value={readOnly ? value : undefined}
defaultValue={value}
disableEmbeds={disableEmbeds}
embedsDisabled={embedsDisabled}
onSynced={this.onSynced}
onImageUploadStart={this.onImageUploadStart}
onImageUploadStop={this.onImageUploadStop}