Merge pull request #5278 from mempool/natsoni/fix-keynav-events

Fix issue on key navigation logic
This commit is contained in:
wiz authored and GitHub committed 2024-07-04 20:13:07 +09:00
commit 2fc89f6a35
2 files changed
+8 -4

No files matched your search

@@ -81,11 +81,13 @@ export class BlocksList implements OnInit {
})
).subscribe();
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
this.keyNavigationSubscription = this.stateService.keyNavigation$
.pipe(
filter((event) => event.key === prevKey || event.key === nextKey),
tap((event) => {
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
if (event.key === prevKey && this.page > 1) {
this.page--;
this.isLoading = true;
@@ -73,11 +73,13 @@ export class RecentPegsListComponent implements OnInit {
}),
).subscribe();
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
this.keyNavigationSubscription = this.stateService.keyNavigation$
.pipe(
filter((event) => event.key === prevKey || event.key === nextKey),
tap((event) => {
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
if (event.key === prevKey && this.page > 1) {
this.page--;
this.isLoading = true;