Skip to content

Commit

Permalink
#95 fix Feature button regression
Browse files Browse the repository at this point in the history
  • Loading branch information
martonsagi committed Apr 2, 2021
1 parent a35ce17 commit 416e844
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions web-ui/src/resources/elements/toolbar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BackendService } from 'services/backend-service';
import { autoinject, bindable } from "aurelia-framework";
import { CommandHandlerService } from 'backend/CommandHandlerService';

@autoinject()
export class Toolbar {
Expand All @@ -12,12 +13,12 @@ export class Toolbar {

loaded: boolean = false;

constructor(private backendService: BackendService) {
constructor(private backendService: BackendService, private commandHandlerService: CommandHandlerService) {
}

async attached() {
try {
let currentSetting = await this.sendCommand('GetConfiguration');
let currentSetting = await this.sendBackendCommand('GetConfiguration');
this.noConfirmations = currentSetting;
} catch {
console.log('GetConfiguration call is not yet implemented');
Expand All @@ -27,6 +28,10 @@ export class Toolbar {
}

async sendCommand(command: string, data?: any) {
await this.commandHandlerService.dispatch(command, data);
}

async sendBackendCommand(command: string, data?: any) {
return await this.backendService.send({ Command: command, Data: data });
}

Expand All @@ -35,6 +40,6 @@ export class Toolbar {
return;
}

this.sendCommand('SetConfiguration', newValue);
this.sendBackendCommand('SetConfiguration', newValue);
}
}

0 comments on commit 416e844

Please sign in to comment.