From 6c15e7d47e536ad4b7b3913d395004a25c368866 Mon Sep 17 00:00:00 2001 From: Chrystian Huot Date: Wed, 1 Dec 2021 11:03:03 -0500 Subject: [PATCH] fix button sound on select panel for TG (beep state inverted) --- .../rdio-scanner/select/select.component.ts | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/client/src/app/components/rdio-scanner/select/select.component.ts b/client/src/app/components/rdio-scanner/select/select.component.ts index 6ae46b6..f6e4459 100644 --- a/client/src/app/components/rdio-scanner/select/select.component.ts +++ b/client/src/app/components/rdio-scanner/select/select.component.ts @@ -51,18 +51,21 @@ export class RdioScannerSelectComponent implements OnDestroy { constructor(private rdioScannerService: RdioScannerService) { } avoid(options?: RdioScannerAvoidOptions): void { - if (options?.all == true) + if (options?.all == true) { this.rdioScannerService.beep(RdioScannerBeepStyle.Activate); - else if (options?.all == false) + + } else if (options?.all == false) { this.rdioScannerService.beep(RdioScannerBeepStyle.Deactivate); - else if ( - options?.system !== undefined && - options?.talkgroup !== undefined && - this.map[options!.system.id][options!.talkgroup.id] == false - ) - this.rdioScannerService.beep(RdioScannerBeepStyle.Deactivate); - else - this.rdioScannerService.beep(RdioScannerBeepStyle.Activate); + + } else if (options?.system !== undefined && options?.talkgroup !== undefined) { + this.rdioScannerService.beep(this.map[options!.system.id][options!.talkgroup.id] + ? RdioScannerBeepStyle.Deactivate + : RdioScannerBeepStyle.Activate + ); + + } else { + this.rdioScannerService.beep(options?.status ? RdioScannerBeepStyle.Activate : RdioScannerBeepStyle.Deactivate); + } this.rdioScannerService.avoid(options); }