Mesh:Tool: actually call set_darkmode() on the CMMS boot path
The real reason Mesh:Tool ignored the theme: set_darkmode() runs inside restore_space(), which only fires on the non-CMMS boot path (motoClient 'ready' -> restore_space). The CMMS path (motoClient 'ready' -> cmms_load_from_url) never called it, so #app never got the .dark class and the #app:not(.dark) light CSS always won -> white, regardless of theme. Now cmms_load_from_url()'s finally block calls set_darkmode(config.dark ?? true).
This commit is contained in:
parent
e58ffd843a
commit
ecd561be21
1 changed files with 5 additions and 0 deletions
|
|
@ -812,6 +812,11 @@ async function cmms_load_from_url(config) {
|
||||||
boot_done();
|
boot_done();
|
||||||
handles.setEnabled(api.prefs.map.space.bounds ?? false);
|
handles.setEnabled(api.prefs.map.space.bounds ?? false);
|
||||||
broker.publish("app_ready");
|
broker.publish("app_ready");
|
||||||
|
// The normal boot path applies dark/light mode inside restore_space(),
|
||||||
|
// which this CMMS-scoped launch deliberately skips - so do it here.
|
||||||
|
// config.dark comes from the CMMS host's theme_is_dark() (cmms_dark
|
||||||
|
// query param); default dark for a non-CMMS/direct launch.
|
||||||
|
set_darkmode(config.dark ?? true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue