Get all pools in accelerations list
This commit is contained in:
		
							parent
							
								
									78ac0137b3
								
							
						
					
					
						commit
						90331e2c1b
					
				| @ -83,9 +83,9 @@ export class AccelerationsListComponent implements OnInit, OnDestroy { | |||||||
|         this.pageChange(this.page); |         this.pageChange(this.page); | ||||||
|       }); |       }); | ||||||
| 
 | 
 | ||||||
|       this.miningService.getMiningStats('1m').subscribe(stats => { |       this.miningService.getPools().subscribe(pools => { | ||||||
|         for (const pool of stats.pools) { |         for (const pool of pools) { | ||||||
|           this.pools[pool.poolUniqueId] = pool; |           this.pools[pool.unique_id] = pool; | ||||||
|         } |         } | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -31,6 +31,7 @@ export class MiningService { | |||||||
|       data: MiningStats; |       data: MiningStats; | ||||||
|     } |     } | ||||||
|   } = {}; |   } = {}; | ||||||
|  |   poolsData: SinglePoolStats[] = []; | ||||||
| 
 | 
 | ||||||
|   constructor( |   constructor( | ||||||
|     private stateService: StateService, |     private stateService: StateService, | ||||||
| @ -57,7 +58,19 @@ export class MiningService { | |||||||
|       ); |       ); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 |    | ||||||
|  |   /**  | ||||||
|  |    * Get names and slugs of all pools | ||||||
|  |    */ | ||||||
|  |   public getPools(): Observable<any[]> { | ||||||
|  |     return this.poolsData.length ? of(this.poolsData) : this.apiService.listPools$(undefined).pipe( | ||||||
|  |       map(response => { | ||||||
|  |         this.poolsData = response.body; | ||||||
|  |         return this.poolsData; | ||||||
|  |       }) | ||||||
|  |     ); | ||||||
|  |      | ||||||
|  |   } | ||||||
|   /** |   /** | ||||||
|    * Set the hashrate power of ten we want to display |    * Set the hashrate power of ten we want to display | ||||||
|    */ |    */ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user