Use url parameter instead of query parameter

This commit is contained in:
natsoni
2024-06-26 15:09:52 +09:00
parent 7b6246a035
commit 09f7dddf14
4 changed files with 16 additions and 9 deletions

View File

@@ -36,7 +36,7 @@ export class RecentPegsListComponent implements OnInit {
lastPegBlockUpdate: number = 0;
lastPegAmount: string = '';
isLoad: boolean = true;
queryParamSubscription: Subscription;
paramSubscription: Subscription;
keyNavigationSubscription: Subscription;
dir: 'rtl' | 'ltr' = 'ltr';
@@ -66,7 +66,7 @@ export class RecentPegsListComponent implements OnInit {
this.seoService.setTitle($localize`:@@a8b0889ea1b41888f1e247f2731cc9322198ca04:Recent Peg-In / Out's`);
this.websocketService.want(['blocks']);
this.queryParamSubscription = this.route.queryParams.pipe(
this.paramSubscription = this.route.params.pipe(
tap((params) => {
this.page = +params['page'] || 1;
this.startingIndexSubject.next((this.page - 1) * 15);
@@ -173,12 +173,12 @@ export class RecentPegsListComponent implements OnInit {
ngOnDestroy(): void {
this.destroy$.next(1);
this.destroy$.complete();
this.queryParamSubscription?.unsubscribe();
this.paramSubscription?.unsubscribe();
this.keyNavigationSubscription?.unsubscribe();
}
pageChange(page: number): void {
this.router.navigate([], { queryParams: { page: page } });
this.router.navigate(['audit', 'pegs', page]);
}
}