Fix pool component hashrate api response handling
This commit is contained in:
parent
6ae20ead63
commit
0803fed0f4
@ -102,7 +102,7 @@ class HashratesRepository {
|
|||||||
/**
|
/**
|
||||||
* Returns a pool hashrate history
|
* Returns a pool hashrate history
|
||||||
*/
|
*/
|
||||||
public async $getPoolWeeklyHashrate(slug: string): Promise<any[]> {
|
public async $getPoolWeeklyHashrate(slug: string): Promise<any[]> {
|
||||||
const pool = await PoolsRepository.$getPool(slug);
|
const pool = await PoolsRepository.$getPool(slug);
|
||||||
if (!pool) {
|
if (!pool) {
|
||||||
throw new Error(`This mining pool does not exist`);
|
throw new Error(`This mining pool does not exist`);
|
||||||
|
@ -56,7 +56,7 @@ export class PoolComponent implements OnInit {
|
|||||||
.pipe(
|
.pipe(
|
||||||
switchMap((data) => {
|
switchMap((data) => {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
this.prepareChartOptions(data.hashrates.map(val => [val.timestamp * 1000, val.avgHashrate]));
|
this.prepareChartOptions(data.map(val => [val.timestamp * 1000, val.avgHashrate]));
|
||||||
return [slug];
|
return [slug];
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user