Hello Guys,
I am designing my own home page instead of using the launcher extension.
My activate function is like following:
function activate(app: JupyterFrontEnd,
palette: ICommandPalette,
labShell: ILabShell,
restorer: ILayoutRestorer | null) {
console.log('JupyterLab extension homepage is activated!');
// Declare a widget variable
let widget: MainAreaWidget<myWidget>;
// Add an application command
const command: string = 'launcher:create';
app.commands.addCommand(command, {
label: 'my Homepage',
execute: () => {
const content = new myWidget();
widget = new MainAreaWidget({content});
widget.id = 'home';
widget.title.label = 'Home';
widget.title.closable = true;
const callback = (item: Widget) => {
labShell.add(item, 'main');
};
app.shell.add(widget, 'main');
app.shell.activateById(widget.id);
labShell.layoutModified.connect(() => {
// If there is only a launcher open, remove the close icon.
widget.title.closable = toArray(app.shell.widgets('main')).length > 1;
}, widget);
category: ('my')
});
}
And i got this error about the callback function is never be used.
src/index.ts:79:13 - error TS6133: ‘callback’ is declared but its value is never read.
79 const callback = (item: Widget) => {
~~~~~~~~Found 1 error in src/index.ts:7