Fix key navigation logic in blocks-list and recent-pegs-list
This commit is contained in:
		
							parent
							
								
									2b96c99fb3
								
							
						
					
					
						commit
						6ed6f2e2cf
					
				| @ -81,11 +81,13 @@ export class BlocksList implements OnInit { | |||||||
|         }) |         }) | ||||||
|       ).subscribe(); |       ).subscribe(); | ||||||
| 
 | 
 | ||||||
|  |       const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight'; | ||||||
|  |       const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft'; | ||||||
|  | 
 | ||||||
|       this.keyNavigationSubscription = this.stateService.keyNavigation$ |       this.keyNavigationSubscription = this.stateService.keyNavigation$ | ||||||
|       .pipe( |       .pipe( | ||||||
|  |         filter((event) => event.key === prevKey || event.key === nextKey), | ||||||
|         tap((event) => { |         tap((event) => { | ||||||
|           const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight'; |  | ||||||
|           const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft'; |  | ||||||
|           if (event.key === prevKey && this.page > 1) { |           if (event.key === prevKey && this.page > 1) { | ||||||
|             this.page--; |             this.page--; | ||||||
|             this.isLoading = true; |             this.isLoading = true; | ||||||
|  | |||||||
| @ -73,11 +73,13 @@ export class RecentPegsListComponent implements OnInit { | |||||||
|         }), |         }), | ||||||
|       ).subscribe(); |       ).subscribe(); | ||||||
| 
 | 
 | ||||||
|  |       const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight'; | ||||||
|  |       const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft'; | ||||||
|  | 
 | ||||||
|       this.keyNavigationSubscription = this.stateService.keyNavigation$ |       this.keyNavigationSubscription = this.stateService.keyNavigation$ | ||||||
|       .pipe( |       .pipe( | ||||||
|  |         filter((event) => event.key === prevKey || event.key === nextKey), | ||||||
|         tap((event) => { |         tap((event) => { | ||||||
|           const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight'; |  | ||||||
|           const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft'; |  | ||||||
|           if (event.key === prevKey && this.page > 1) { |           if (event.key === prevKey && this.page > 1) { | ||||||
|             this.page--; |             this.page--; | ||||||
|             this.isLoading = true; |             this.isLoading = true; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user