[fix] themes: run \#invoke after class constructor (#5757)

Move \#invoke into a microtask that will run after current call stack completes

Closes: https://github.com/searxng/searxng/issues/5756
This commit is contained in:
Ivan Gabaldon
2026-02-20 13:00:17 +01:00
committed by GitHub
parent 4e6e8425ca
commit 93ac6ceb35
8 changed files with 12 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ export abstract class Plugin {
protected constructor(id: string) {
this.id = id;
void this.invoke();
queueMicrotask(() => this.invoke());
}
private async invoke(): Promise<void> {

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import "ol/ol.css?inline";
import "ol/ol.css";
import { Feature, Map as OlMap, View } from "ol";
import { GeoJSON } from "ol/format";
import { Point } from "ol/geom";