Kaynağa Gözat

Reload the application on manual state reset

Afshin T. Darian 4 yıl önce
ebeveyn
işleme
4c23781315

+ 4 - 1
packages/apputils-extension/src/index.ts

@@ -373,9 +373,12 @@ const state: JupyterFrontEndPlugin<IStateDB> = {
 
     commands.addCommand(CommandIDs.reset, {
       label: 'Reset Application State',
-      execute: async () => {
+      execute: async ({ reload }: { reload: boolean }) => {
         await db.clear();
         await save.invoke();
+        if (reload) {
+          router.reload();
+        }
       }
     });
 

+ 5 - 1
packages/help-extension/src/index.tsx

@@ -390,7 +390,11 @@ function activate(
     RESOURCES.forEach(args => {
       palette.addItem({ args, command: CommandIDs.open, category });
     });
-    palette.addItem({ command: 'apputils:reset', category });
+    palette.addItem({
+      args: { reload: true },
+      command: 'apputils:reset',
+      category
+    });
     palette.addItem({ command: CommandIDs.launchClassic, category });
   }
 }