From 05e24df22671ee276d9b3bce403c4dcdef1ee348 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 31 May 2020 22:46:55 -0700 Subject: [PATCH] fix: Update value when saved elsewhere and viewing doc closes #1103 --- app/scenes/Document/components/Document.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scenes/Document/components/Document.js b/app/scenes/Document/components/Document.js index 20e3a4c52e..78593ecdd2 100644 --- a/app/scenes/Document/components/Document.js +++ b/app/scenes/Document/components/Document.js @@ -281,6 +281,7 @@ class DocumentScene extends React.Component { return ; } + const value = revision ? revision.text : document.text; const disableEmbeds = (team && team.documentEmbeds === false) || document.embedsDisabled; @@ -378,7 +379,8 @@ class DocumentScene extends React.Component { key={disableEmbeds ? 'embeds-disabled' : 'embeds-enabled'} title={revision ? revision.title : this.title} document={document} - defaultValue={revision ? revision.text : document.text} + value={readOnly ? value : undefined} + defaultValue={value} disableEmbeds={disableEmbeds} onImageUploadStart={this.onImageUploadStart} onImageUploadStop={this.onImageUploadStop}