Clear mining service cache on network change
This commit is contained in:
parent
5eb117165f
commit
b62ae9b6f6
@ -37,7 +37,11 @@ export class MiningService {
|
|||||||
private stateService: StateService,
|
private stateService: StateService,
|
||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
private storageService: StorageService,
|
private storageService: StorageService,
|
||||||
) { }
|
) {
|
||||||
|
this.stateService.networkChanged$.subscribe((network) => {
|
||||||
|
this.clearCache();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate pool ranking stats
|
* Generate pool ranking stats
|
||||||
@ -141,4 +145,9 @@ export class MiningService {
|
|||||||
totalBlockCount: parseInt(response.headers.get('x-total-count'), 10),
|
totalBlockCount: parseInt(response.headers.get('x-total-count'), 10),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private clearCache(): void {
|
||||||
|
this.cache = {};
|
||||||
|
this.poolsData = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user