Browse Source

Handle a canceled save in the SaveHandler.

Ian Rose 7 years ago
parent
commit
f6fde01b1e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      packages/docmanager/src/savehandler.ts

+ 5 - 0
packages/docmanager/src/savehandler.ts

@@ -134,6 +134,11 @@ class SaveHandler implements IDisposable {
       // Restart the update to pick up the new interval.
       // Restart the update to pick up the new interval.
       this._setTimer();
       this._setTimer();
     }).catch(err => {
     }).catch(err => {
+      // If the user canceled the save, do nothing.
+      if (err.message === 'Cancel') {
+        return;
+      }
+      // Otherwise, log the error.
       console.error('Error in Auto-Save', err.message);
       console.error('Error in Auto-Save', err.message);
     });
     });
   }
   }