@@ -65,7 +74,7 @@ class UnsafeAlert extends Component {
}
// Show unsafe alert
- if (!window.NativeRobosats && !this.safe_urls.includes(getHost())) {
+ else if (this.props.settings.unsafeClient) {
return (
diff --git a/frontend/src/models/Settings.default.basic.ts b/frontend/src/models/Settings.default.basic.ts
index e640115c..7355db3b 100644
--- a/frontend/src/models/Settings.default.basic.ts
+++ b/frontend/src/models/Settings.default.basic.ts
@@ -1,8 +1,13 @@
+import { systemClient } from '../services/System';
import { baseSettings, Settings } from './Settings.model';
+const fontSizeCookie = systemClient.getCookie('settings_fontsize_basic');
+const fontSize = fontSizeCookie !== '' ? Number(fontSizeCookie) : 14;
+
export const defaultSettings: Settings = {
...baseSettings,
frontend: 'basic',
+ fontSize: fontSize,
};
export default defaultSettings;
diff --git a/frontend/src/models/Settings.default.pro.ts b/frontend/src/models/Settings.default.pro.ts
index d7c9829b..bad6841c 100644
--- a/frontend/src/models/Settings.default.pro.ts
+++ b/frontend/src/models/Settings.default.pro.ts
@@ -1,9 +1,13 @@
+import { systemClient } from '../services/System';
import { baseSettings, Settings } from './Settings.model';
+const fontSizeCookie = systemClient.getCookie('settings_fontsize_pro');
+const fontSize = fontSizeCookie !== '' ? Number(fontSizeCookie) : 12;
+
export const defaultSettings: Settings = {
...baseSettings,
- fontSize: 12,
frontend: 'pro',
+ fontSize: fontSize,
};
export default defaultSettings;
diff --git a/frontend/src/models/Settings.model.ts b/frontend/src/models/Settings.model.ts
index 147980b0..f503e2b6 100644
--- a/frontend/src/models/Settings.model.ts
+++ b/frontend/src/models/Settings.model.ts
@@ -1,4 +1,5 @@
import i18n from '../i18n/Web';
+import { systemClient } from '../services/System';
import type Coordinator from './Coordinator.model';
export type Language =
@@ -27,20 +28,36 @@ export interface Settings {
freezeViewports: boolean;
network: 'mainnet' | 'testnet' | undefined;
coordinator: Coordinator | undefined;
+ unsafeClient: boolean;
+ hostedClient: boolean;
}
+const modeCookie: 'light' | 'dark' | '' = systemClient.getCookie('settings_mode');
+const mode: 'light' | 'dark' =
+ modeCookie !== ''
+ ? modeCookie
+ : window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
+ ? 'dark'
+ : 'light';
+
+const languageCookie = systemClient.getCookie('settings_language');
+const language: Language =
+ languageCookie !== ''
+ ? languageCookie
+ : i18n.resolvedLanguage == null
+ ? 'en'
+ : i18n.resolvedLanguage.substring(0, 2);
+
export const baseSettings: Settings = {
frontend: 'basic',
- mode:
- window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
- ? 'dark'
- : 'light',
+ mode: mode,
fontSize: 14,
- language:
- i18n.resolvedLanguage == null ? 'en' : (i18n.resolvedLanguage.substring(0, 2) as Language),
+ language: language,
freezeViewports: false,
network: undefined,
coordinator: undefined,
+ unsafeClient: false,
+ hostedClient: false,
};
export default Settings;