@@ -14,10 +14,12 @@ import {
1414 CLUSTER_INFO_HIDDEN_KEY ,
1515 LAST_USED_QUERY_ACTION_KEY ,
1616 USE_BACKEND_PARAMS_FOR_TABLES_KEY ,
17+ LANGUAGE_KEY ,
1718} from '../../../utils/constants' ;
1819import '../../../services/api' ;
19- import { getValueFromLS , parseJson } from '../../../utils/utils' ;
20+ import { parseJson } from '../../../utils/utils' ;
2021import { QUERY_ACTIONS , QUERY_MODES } from '../../../utils/query' ;
22+ import { readSavedSettingsValue , systemSettings , userSettings } from '../../../utils/settings' ;
2123
2224import { TENANT_PAGES_IDS } from '../tenant/constants' ;
2325
@@ -38,20 +40,12 @@ export const ProblemFilterValues = {
3840 PROBLEMS : 'With problems' ,
3941} as const ;
4042
41- const userSettings = window . userSettings || { } ;
42- const systemSettings = window . systemSettings || { } ;
43-
44- export function readSavedSettingsValue ( key : string , defaultValue ?: string ) {
45- const savedValue = window . web_version ? userSettings [ key ] : getValueFromLS ( key ) ;
46-
47- return savedValue ?? defaultValue ;
48- }
49-
5043export const initialState = {
5144 problemFilter : ProblemFilterValues . ALL ,
5245 userSettings : {
5346 ...userSettings ,
5447 [ THEME_KEY ] : readSavedSettingsValue ( THEME_KEY , 'system' ) ,
48+ [ LANGUAGE_KEY ] : readSavedSettingsValue ( LANGUAGE_KEY ) ,
5549 [ INVERTED_DISKS_KEY ] : readSavedSettingsValue ( INVERTED_DISKS_KEY , 'false' ) ,
5650 [ USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY ] : readSavedSettingsValue (
5751 USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY ,
0 commit comments