Skip to content

Commit

Permalink
Make IStatusBar optional for the notifciation plugin (jupyterlab#14593
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jtpio authored May 27, 2023
1 parent 7a30f77 commit f564568
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/apputils-extension/src/notificationplugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,10 @@ export const notificationPlugin: JupyterFrontEndPlugin<void> = {
id: '@jupyterlab/apputils-extension:notification',
description: 'Add the notification center and its status indicator.',
autoStart: true,
requires: [IStatusBar],
optional: [ISettingRegistry, ITranslator],
optional: [IStatusBar, ISettingRegistry, ITranslator],
activate: (
app: JupyterFrontEnd,
statusBar: IStatusBar,
statusBar: IStatusBar | null,
settingRegistry: ISettingRegistry | null,
translator: ITranslator | null
): void => {
Expand Down Expand Up @@ -624,11 +623,13 @@ export const notificationPlugin: JupyterFrontEndPlugin<void> = {

notificationStatus.addClass('jp-Notification-Status');

statusBar.registerStatusItem(notificationPlugin.id, {
item: notificationStatus,
align: 'right',
rank: -1
});
if (statusBar) {
statusBar.registerStatusItem(notificationPlugin.id, {
item: notificationStatus,
align: 'right',
rank: -1
});
}
}
};

Expand Down

0 comments on commit f564568

Please sign in to comment.