@@ -14,10 +14,12 @@ import {
14
14
CLUSTER_INFO_HIDDEN_KEY ,
15
15
LAST_USED_QUERY_ACTION_KEY ,
16
16
USE_BACKEND_PARAMS_FOR_TABLES_KEY ,
17
+ LANGUAGE_KEY ,
17
18
} from '../../../utils/constants' ;
18
19
import '../../../services/api' ;
19
- import { getValueFromLS , parseJson } from '../../../utils/utils' ;
20
+ import { parseJson } from '../../../utils/utils' ;
20
21
import { QUERY_ACTIONS , QUERY_MODES } from '../../../utils/query' ;
22
+ import { readSavedSettingsValue , systemSettings , userSettings } from '../../../utils/settings' ;
21
23
22
24
import { TENANT_PAGES_IDS } from '../tenant/constants' ;
23
25
@@ -38,20 +40,12 @@ export const ProblemFilterValues = {
38
40
PROBLEMS : 'With problems' ,
39
41
} as const ;
40
42
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
-
50
43
export const initialState = {
51
44
problemFilter : ProblemFilterValues . ALL ,
52
45
userSettings : {
53
46
...userSettings ,
54
47
[ THEME_KEY ] : readSavedSettingsValue ( THEME_KEY , 'system' ) ,
48
+ [ LANGUAGE_KEY ] : readSavedSettingsValue ( LANGUAGE_KEY ) ,
55
49
[ INVERTED_DISKS_KEY ] : readSavedSettingsValue ( INVERTED_DISKS_KEY , 'false' ) ,
56
50
[ USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY ] : readSavedSettingsValue (
57
51
USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY ,
0 commit comments