Skip to content

Commit

Permalink
Restore close and shutdown confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-chand04 authored Jul 25, 2024
1 parent 43b8cce commit 1b5a56b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,15 @@ const closeTab: JupyterFrontEndPlugin<void> = {
commands.addCommand(id, {
label: trans.__('Close and Shut Down Notebook'),
execute: async () => {
// Shut the kernel down, without confirmation
await commands.execute('notebook:shutdown-kernel', { activate: false });
window.close();
const confirm = window.confirm(
trans.__('Are you sure you want to close and shut down the notebook?')
);
if (confirm) {
await commands.execute('notebook:shutdown-kernel', {
activate: false,
});
window.close();
}
},
});
menu.fileMenu.closeAndCleaners.add({
Expand Down

0 comments on commit 1b5a56b

Please sign in to comment.