Prevents accidental overwriting of another users work
This commit is contained in:
@@ -39,6 +39,7 @@ class Document extends BaseModel {
|
||||
updatedBy: User;
|
||||
url: string;
|
||||
views: number;
|
||||
revision: number;
|
||||
|
||||
data: Object;
|
||||
|
||||
@@ -168,6 +169,7 @@ class Document extends BaseModel {
|
||||
id: this.id,
|
||||
title: this.title,
|
||||
text: this.text,
|
||||
lastRevision: this.revision,
|
||||
});
|
||||
} else {
|
||||
if (!this.title) {
|
||||
|
||||
@@ -232,7 +232,7 @@ class DocumentScene extends Component {
|
||||
message={DISCARD_CHANGES}
|
||||
/>
|
||||
<Editor
|
||||
key={document.id}
|
||||
key={`${document.id}-${document.revision}`}
|
||||
text={document.text}
|
||||
emoji={document.emoji}
|
||||
onImageUploadStart={this.onImageUploadStart}
|
||||
|
||||
Reference in New Issue
Block a user