Ver Fonte

Handle a canceled save in the SaveHandler.

Ian Rose há 7 anos atrás
pai
commit
f6fde01b1e
1 ficheiros alterados com 5 adições e 0 exclusões
  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.
       this._setTimer();
     }).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);
     });
   }