File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -642,7 +642,7 @@ export default {
642642 this .emit (' ready' )
643643 }
644644 if (Object .prototype .hasOwnProperty .call (state, ' dirty' )) {
645- // ignore initial loading and other automated changes
645+ // ignore initial loading and other automated changes before first user change
646646 if (this .$editor
647647 && (this .$editor .can ().undo () || this .$editor .can ().redo ())
648648 ) {
Original file line number Diff line number Diff line change @@ -86,22 +86,19 @@ export default {
8686 return this .dirtyStateIndicator ? t (' text' , ' Saving …' ) : t (' text' , ' Saved' )
8787 },
8888 dirtyStateIndicator () {
89- return this .dirty || this . hasUnsavedChanges
89+ return this .dirty
9090 },
9191 lastSavedStatusTooltip () {
9292 let message = t (' text' , ' Last saved {lastSave}' , { lastSave: this .lastSavedString })
9393 if (this .hasSyncCollission ) {
9494 message = t (' text' , ' The document has been changed outside of the editor. The changes cannot be applied.' )
9595 }
96- if (this .dirty || this . hasUnsavedChanges ) {
96+ if (this .dirty ) {
9797 message += ' - ' + t (' text' , ' Unsaved changes' )
9898 }
9999 return message
100100 },
101101
102- hasUnsavedChanges () {
103- return this .document && this .document .lastSavedVersion < this .document .currentVersion
104- },
105102 hasSyncCollission () {
106103 return this .syncError && this .syncError .type === ERROR_TYPE .SAVE_COLLISSION
107104 },
Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ class SyncService {
218218 this . emit ( 'error' , { type : ERROR_TYPE . PUSH_FORBIDDEN , data : { } } )
219219 }
220220 // TODO: does response.data ever have a document? maybe for errors?
221+ // TODO: `currentVersion` is always 0 nowadays. Check if this is still needed.
221222 // Only emit conflict event if we have synced until the latest version
222223 if ( response . data . document ?. currentVersion === this . version ) {
223224 this . emit ( 'error' , { type : ERROR_TYPE . PUSH_FAILURE , data : { } } )
You can’t perform that action at this time.
0 commit comments