Skip to content

Commit

Permalink
Handle the missing IThemeManager case
Browse files Browse the repository at this point in the history
Signed-off-by: Duc Trung LE <[email protected]>
  • Loading branch information
trungleduc authored and ibdafna committed Nov 9, 2022
1 parent 0c2c4ce commit b398f20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ export default datagridPlugin;
function activateWidgetExtension(
app: Application<Widget>,
registry: IJupyterWidgetRegistry,
themeManager: IThemeManager,
themeManager: IThemeManager | null,
): void {
// Exporting a patched DataGridView widget which handles dynamic theme changes
class DataGridView extends widgetExports.DataGridView {
initialize(parameters: WidgetView.IInitializeParameters) {
if (themeManager.theme != null) {
if (themeManager?.theme != null) {
this.isLightTheme = themeManager.isLight(themeManager.theme);
}
super.initialize(parameters);
Expand All @@ -55,7 +55,7 @@ function activateWidgetExtension(
}

private onThemeChanged() {
if (themeManager.theme != null) {
if (themeManager?.theme != null) {
this.isLightTheme = themeManager.isLight(themeManager.theme);
}
this.updateGridStyle();
Expand Down

0 comments on commit b398f20

Please sign in to comment.