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