Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
notebookTracker: INotebookTracker,
consoleTracker: IConsoleTracker,
labShell: ILabShell
) => {
// When the status item is clicked, launch the kernel
// selection dialog for the current session.
let currentSession: IClientSession | null = null;
const changeKernel = async () => {
if (!currentSession) {
return;
}
await currentSession.selectKernel();
};
// Create the status item.
const item = new KernelStatus({
onClick: changeKernel
});
// When the title of the active widget changes, update the label
// of the hover text.
const onTitleChanged = (title: Title) => {
item.model!.activityName = title.label;
};
// Keep the session object on the status item up-to-date.
labShell.currentChanged.connect((_, change) => {
const { oldValue, newValue } = change;
// Clean up after the old value if it exists,
// listen for changes to the title of the activity
if (oldValue) {
notebookTracker: INotebookTracker,
consoleTracker: IConsoleTracker,
labShell: ILabShell
) => {
// When the status item is clicked, launch the kernel
// selection dialog for the current session.
let currentSession: IClientSession | null = null;
const changeKernel = async () => {
if (!currentSession) {
return;
}
await currentSession.selectKernel();
};
// Create the status item.
const item = new KernelStatus({
onClick: changeKernel
});
// When the title of the active widget changes, update the label
// of the hover text.
const onTitleChanged = (title: Title) => {
item.model!.activityName = title.label;
};
// Keep the session object on the status item up-to-date.
labShell.currentChanged.connect((_, change) => {
const { oldValue, newValue } = change;
// Clean up after the old value if it exists,
// listen for changes to the title of the activity
if (oldValue) {