Skip to content

Commit 7036850

Browse files
committed
Fix chart data source key for local storage
1 parent 7c15658 commit 7036850

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

main/http_server/axe-os/src/app/components/home/home.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { chartLabelValue } from 'src/models/enum/eChartLabel';
1919
import { chartLabelKey } from 'src/models/enum/eChartLabel';
2020
import { LocalStorageService } from 'src/app/local-storage.service';
2121

22+
const HOME_CHART_DATA_SOURCES = 'HOME_CHART_DATA_SOURCES';
23+
2224
@Component({
2325
selector: 'app-home',
2426
templateUrl: './home.component.html',
@@ -84,7 +86,7 @@ export class HomeComponent implements OnInit, OnDestroy {
8486
this.pageDefaultTitle = this.titleService.getTitle();
8587
this.loadingService.loading$.next(true);
8688

87-
let dataSources = this.storageService.getItem('chartDataSources');
89+
let dataSources = this.storageService.getItem(HOME_CHART_DATA_SOURCES);
8890
if (dataSources === null) {
8991
dataSources = `{"chartY1Data":"${chartLabelKey(eChartLabel.hashrate)}",`;
9092
dataSources += `"chartY2Data":"${chartLabelKey(eChartLabel.asicTemp)}"}`;
@@ -136,7 +138,7 @@ export class HomeComponent implements OnInit, OnDestroy {
136138
public updateSystem() {
137139
const form = this.form.getRawValue();
138140

139-
this.storageService.setItem('chartDataSources', JSON.stringify(form));
141+
this.storageService.setItem(HOME_CHART_DATA_SOURCES, JSON.stringify(form));
140142

141143
this.systemService.updateSystem(this.uri, form)
142144
.pipe(this.loadingService.lockUIUntilComplete())

0 commit comments

Comments
 (0)