Make dev-console use in WebServerService optional

This commit is contained in:
KernelDeimos 2024-04-01 19:40:59 -04:00
parent 40c2e3f442
commit 59003a9ab9

View File

@ -128,8 +128,8 @@ class WebServerService extends BaseService {
return lines;
};
{
const svc_devConsole = this.services.get('dev-console');
svc_devConsole.add_widget(this.startup_widget);
const svc_devConsole = this.services.get('dev-console', { optional: true });
if ( svc_devConsole ) svc_devConsole.add_widget(this.startup_widget);
}
this.print_puter_logo_();
@ -330,8 +330,8 @@ class WebServerService extends BaseService {
id: 'dismiss',
description: 'Dismiss the startup message',
handler: async () => {
const svc_devConsole = this.services.get('dev-console');
svc_devConsole.remove_widget(this.startup_widget);
const svc_devConsole = this.services.get('dev-console', { optional: true });
if ( svc_devConsole ) svc_devConsole.remove_widget(this.startup_widget);
}
}
]);