From 95bab6442455cb983823704f2e3bd547a7203e67 Mon Sep 17 00:00:00 2001 From: softsimon Date: Tue, 11 Aug 2020 00:01:22 +0700 Subject: [PATCH] Fixes for bisq pagination and tx type select history --- .../bisq-transactions/bisq-transactions.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/bisq/bisq-transactions/bisq-transactions.component.ts b/frontend/src/app/bisq/bisq-transactions/bisq-transactions.component.ts index 4d90282f1..5a6039bbb 100644 --- a/frontend/src/app/bisq/bisq-transactions/bisq-transactions.component.ts +++ b/frontend/src/app/bisq/bisq-transactions/bisq-transactions.component.ts @@ -40,6 +40,7 @@ export class BisqTransactionsComponent implements OnInit { { id: 11, name: 'Unlock' }, { id: 12, name: 'Vote reveal' }, ]; + txTypesDefaultChecked = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; txTypeDropdownSettings: IMultiSelectSettings = { buttonClasses: 'btn btn-primary btn-sm', @@ -74,7 +75,7 @@ export class BisqTransactionsComponent implements OnInit { this.seoService.setTitle('Transactions', true); this.radioGroupForm = this.formBuilder.group({ - txTypes: [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]], + txTypes: [this.txTypesDefaultChecked], }); this.loadingItems = Array(this.itemsPerPage); @@ -84,8 +85,6 @@ export class BisqTransactionsComponent implements OnInit { this.paginationMaxSize = 3; } - this.route.queryParams.subscribe(() => console.log('changed')); - this.transactions$ = merge( this.route.queryParams .pipe( @@ -101,13 +100,18 @@ export class BisqTransactionsComponent implements OnInit { if (queryParams.page) { const newPage = parseInt(queryParams.page, 10); this.page = newPage; - this.cd.markForCheck(); + } else { + this.page = 1; } if (queryParams.types) { const types = queryParams.types.split(',').map((str: string) => parseInt(str, 10)); this.types = types.map((id: number) => this.txTypes[id - 1]); this.radioGroupForm.get('txTypes').setValue(types, { emitEvent: false }); + } else { + this.types = []; + this.radioGroupForm.get('txTypes').setValue(this.txTypesDefaultChecked, { emitEvent: false }); } + this.cd.markForCheck(); }) ), this.radioGroupForm.valueChanges