Skip to content

Commit d4f82de

Browse files
dbg
1 parent 65fb3b6 commit d4f82de

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

kernel/src/index.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
// Removed Widget import as we're no longer using @lumino/widgets
21
import { JupyterLiteServer, JupyterLiteServerPlugin } from '@jupyterlite/server';
32
import { IKernel, IKernelSpecs } from '@jupyterlite/kernel';
4-
import { INotebookTracker} from '@jupyterlab/notebook';
3+
import { INotebookTracker } from '@jupyterlab/notebook';
54
import { EmbeddedKernel } from './kernel';
65
import WelcomePanel from './panel';
76
import { ServiceContainer } from './services/ServiceContainer';
87
import { DeviceService } from './services/DeviceService';
98

10-
// Variable for saving the DeviceService instance so we can restore it if kernel is restarted
119
var devService: DeviceService | null = null;
1210

13-
// Kernel plugin for the embedded kernel
1411
const kernelPlugin: JupyterLiteServerPlugin<void> = {
1512
id: 'jupyterlite-embedded-kernel:kernel',
1613
autoStart: true,
17-
requires: [IKernelSpecs],
18-
activate: (app: JupyterLiteServer, kernelspecs: IKernelSpecs) => {
14+
requires: [IKernelSpecs, INotebookTracker], // Add INotebookTracker here
15+
activate: (
16+
app: JupyterLiteServer,
17+
kernelspecs: IKernelSpecs,
18+
notebookTracker: INotebookTracker // Add notebookTracker parameter
19+
) => {
1920
const activeKernels = new Map<string, EmbeddedKernel>();
2021

2122
app.router.post('/api/kernels/(.*)/interrupt', async (req, kernelId: string) => {
@@ -49,20 +50,17 @@ const kernelPlugin: JupyterLiteServerPlugin<void> = {
4950
const serviceContainer = new ServiceContainer(devService);
5051
await serviceContainer.init();
5152

52-
// Save the DeviceService instance so we can restore it if kernel is restarted
5353
devService = serviceContainer.deviceService;
5454

5555
const welcomePanel = new WelcomePanel(
5656
serviceContainer,
57-
notebookTracker
57+
notebookTracker // Pass notebookTracker here
5858
);
5959
document.body.appendChild(welcomePanel.getElement());
6060
const kernel = new EmbeddedKernel(options, serviceContainer);
6161

62-
// welcomePanel.show();
6362
welcomePanel.initialShow();
6463

65-
// If the deivce is already connected, update the welcome panel
6664
if (serviceContainer.deviceService.isConnected()) {
6765
welcomePanel.updateOnConnection("Connected");
6866
}

0 commit comments

Comments
 (0)