Fix history event handler accumulation

This commit is contained in:
Sipke Schoorstra 2021-12-14 13:00:28 +01:00
parent e6331b20db
commit f01d300e89
2 changed files with 12 additions and 13 deletions

View file

@ -55,6 +55,17 @@ export class ElsaWorkflowInstanceListScreen {
i18next: i18n;
selectAllCheckboxEl: any;
unlistenRouteChanged: () => void;
connectedCallback() {
if (!!this.history)
this.unlistenRouteChanged = this.history.listen(e => this.routeChanged(e));
}
disconnectedCallback() {
if (!!this.unlistenRouteChanged)
this.unlistenRouteChanged();
}
async componentWillLoad() {
this.i18next = await loadTranslations(this.culture, resources);
@ -64,10 +75,8 @@ export class ElsaWorkflowInstanceListScreen {
this.selectedWorkflowStatus = this.workflowStatus;
this.selectedOrderByState = this.orderBy;
if (!!this.history) {
this.history.listen(e => this.routeChanged(e));
if (!!this.history)
this.applyQueryString(this.history.location.search);
}
await this.loadWorkflowBlueprints();
await this.loadWorkflowInstances();

View file

@ -1,10 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Warning",
"Orleans": "Warning",
"System": "Information",
"Microsoft": "Warning"
}
}
}