fix async issues
This commit is contained in:
parent
4f1ed14f07
commit
9c98c631af
@ -20,10 +20,9 @@
|
||||
class QueryParserGenerator {
|
||||
constructor() {
|
||||
this._templateHandler = null;
|
||||
this._initialize();
|
||||
}
|
||||
|
||||
async _initialize() {
|
||||
async prepare() {
|
||||
const html = await apiGetQueryParserTemplatesHtml();
|
||||
this._templateHandler = new TemplateHandler(html);
|
||||
}
|
||||
|
@ -31,6 +31,10 @@ class QueryParser extends TextScanner {
|
||||
this.queryParserGenerator = new QueryParserGenerator();
|
||||
}
|
||||
|
||||
async prepare() {
|
||||
await this.queryParserGenerator.prepare();
|
||||
}
|
||||
|
||||
onError(error) {
|
||||
logError(error, false);
|
||||
}
|
||||
|
@ -49,6 +49,8 @@ class DisplaySearch extends Display {
|
||||
try {
|
||||
await this.initialize();
|
||||
|
||||
await this.queryParser.prepare();
|
||||
|
||||
const {queryParams: {query='', mode=''}} = parseUrl(window.location.href);
|
||||
|
||||
if (this.search !== null) {
|
||||
|
Loading…
Reference in New Issue
Block a user