Explorar el Código

Don't throw error on user-canceled save.

Ian Rose hace 7 años
padre
commit
b890b7d1a4
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      packages/docmanager-extension/src/index.ts

+ 9 - 1
packages/docmanager-extension/src/index.ts

@@ -285,7 +285,15 @@ function addCommands(app: JupyterLab, docManager: IDocumentManager, palette: ICo
             buttons: [Dialog.okButton()]
           });
         }
-        return context.save().then(() => context.createCheckpoint());
+        return context.save()
+          .then(() => context.createCheckpoint())
+          .catch(err => {
+            // If the save was canceled by user-action, do nothing.
+            if (err.message === 'Cancel') {
+              return;
+            }
+            throw err;
+          });
       }
     }
   });