diff --git a/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index f60f15bbb..97fe378cf 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -40,6 +40,10 @@ const DISCARD_CHANGES = ` You have unsaved changes. Are you sure you want to discard them? `; +const UPLOADING_WARNING = ` +Image are still uploading. +Are you sure you want to discard them? +`; type Props = { match: Object, @@ -60,7 +64,7 @@ class DocumentScene extends React.Component { @observable editCache: ?string; @observable document: ?Document; @observable newDocument: ?Document; - @observable isLoading = false; + @observable isUploading = false; @observable isSaving = false; @observable isPublishing = false; @observable notFound = false; @@ -180,11 +184,11 @@ class DocumentScene extends React.Component { }, AUTOSAVE_INTERVAL); onImageUploadStart = () => { - this.isLoading = true; + this.isUploading = true; }; onImageUploadStop = () => { - this.isLoading = false; + this.isUploading = false; }; onChange = text => { @@ -261,7 +265,7 @@ class DocumentScene extends React.Component { {isMoving && document && } {titleText && } - {(this.isLoading || this.isSaving) && } + {(this.isUploading || this.isSaving) && } {!document || !Editor ? ( @@ -269,10 +273,13 @@ class DocumentScene extends React.Component { ) : ( {this.isEditing && ( - + + + + )}