update to use cachedRequest

This commit is contained in:
takuabonn
2023-12-13 21:48:41 +09:00
parent 89eb7ec90b
commit 7cb58ed988
3 changed files with 47 additions and 5 deletions

View File

@@ -81,9 +81,9 @@ export class LightningStatisticsChartComponent implements OnInit {
firstRun = false;
this.miningWindowPreference = timespan;
this.isLoading = true;
return this.lightningApiService.listStatistics$(timespan)
return this.lightningApiService.cachedRequest(this.lightningApiService.listStatistics$, 250, timespan)
.pipe(
tap((response) => {
tap((response:any) => {
const data = response.body;
this.prepareChartOptions({
channel_count: data.map(val => [val.added * 1000, val.channel_count]),