@@ -19,6 +19,8 @@ import { chartLabelValue } from 'src/models/enum/eChartLabel';
1919import { chartLabelKey } from 'src/models/enum/eChartLabel' ;
2020import { 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