diff --git a/frontend/src/app/services/mining.service.ts b/frontend/src/app/services/mining.service.ts index 64748e547..0dffa0b66 100644 --- a/frontend/src/app/services/mining.service.ts +++ b/frontend/src/app/services/mining.service.ts @@ -37,7 +37,11 @@ export class MiningService { private stateService: StateService, private apiService: ApiService, private storageService: StorageService, - ) { } + ) { + this.stateService.networkChanged$.subscribe((network) => { + this.clearCache(); + }); + } /** * Generate pool ranking stats @@ -141,4 +145,9 @@ export class MiningService { totalBlockCount: parseInt(response.headers.get('x-total-count'), 10), }; } + + private clearCache(): void { + this.cache = {}; + this.poolsData = []; + } }