Fix #7398: call layout.init only after SiteSettings are in place (#7402)

This commit is contained in:
Ofek
2025-02-18 21:31:10 +02:00
committed by GitHub
parent cfcbcd7423
commit d3ce34dca6
2 changed files with 8 additions and 4 deletions

View File

@@ -228,10 +228,13 @@ export class Hub {
},
this,
);
}
layout.init();
public initLayout() {
// To be called after setupSettings, as layout.init depends on them
this.layout.init();
this.undefer();
layout.eventHub.emit('initialised');
this.layout.eventHub.emit('initialised');
}
public nextTreeId(): number {

View File

@@ -626,6 +626,9 @@ function start() {
hub = new Hub(layout, subLangId, defaultLangId);
}
const [themer, settings] = setupSettings(hub);
hub.initLayout();
setSentryLayout(layout);
if (hub.hasTree()) {
@@ -641,8 +644,6 @@ function start() {
new clipboard('.btn.clippy');
const [themer, settings] = setupSettings(hub);
function handleCtrlS(event: JQuery.KeyDownEvent<Window, undefined, Window, Window>): void {
event.preventDefault();
if (settings.enableCtrlS === 'false') {