@@ -282,9 +282,9 @@ export class LabView implements IDisposable {
282282
283283 await this . _view . webContents . executeJavaScript ( `
284284 {
285- jlabDesktop_setUIMode('${ this . _uiMode } ', ${ userSettings . getValue (
286- SettingType . showTOCInZenMode
287- ) } );
285+ jlabDesktop_setUIMode('${ this . _uiMode } ', {
286+ showTOCInZenMode: ${ userSettings . getValue ( SettingType . showTOCInZenMode ) }
287+ });
288288 }
289289 ` ) ;
290290 }
@@ -465,7 +465,7 @@ export class LabView implements IDisposable {
465465 });
466466 }
467467
468- async function jlabDesktop_setUIMode(uiMode, showTOCInZenMode ) {
468+ async function jlabDesktop_setUIMode(uiMode, options ) {
469469 const lab = await jlabDesktop_getLab();
470470 const labShell = lab.shell;
471471 const statusBar = labShell.widgets('bottom').find(widget => widget.id === 'jp-main-statusbar');
@@ -520,7 +520,7 @@ export class LabView implements IDisposable {
520520 statusBar.setHidden(true);
521521 }
522522 }
523- if (showTOCInZenMode) {
523+ if (options?. showTOCInZenMode) {
524524 labShell.activateById('table-of-contents');
525525 }
526526 }
@@ -529,9 +529,14 @@ export class LabView implements IDisposable {
529529 jlabDesktop_getLab().then((lab) => {
530530 ${
531531 setToSingleFileUIMode
532- ? `jlabDesktop_setUIMode('${ userSettings . getValue (
533- SettingType . uiModeForSingleFileOpen
534- ) } ', ${ userSettings . getValue ( SettingType . showTOCInZenMode ) } );`
532+ ? `jlabDesktop_setUIMode(
533+ '${ userSettings . getValue (
534+ SettingType . uiModeForSingleFileOpen
535+ ) } ', {
536+ showTOCInZenMode: ${ userSettings . getValue (
537+ SettingType . showTOCInZenMode
538+ ) }
539+ });`
535540 : ''
536541 }
537542 lab.restored.then(() => {
0 commit comments