diff --git a/frontend/src/components/SettingsForm/index.tsx b/frontend/src/components/SettingsForm/index.tsx index 9f211e24..4417529e 100644 --- a/frontend/src/components/SettingsForm/index.tsx +++ b/frontend/src/components/SettingsForm/index.tsx @@ -129,7 +129,10 @@ const SettingsForm = ({ onChange={(e) => { const fontSize = e.target.value; setSettings({ ...settings, fontSize }); - systemClient.setCookie(`settings_fontsize_${settings.frontend}`, fontSize); + systemClient.setCookie( + `settings_fontsize_${settings.frontend}`, + fontSize.toString(), + ); }} valueLabelDisplay='off' marks={fontSizes.map(({ label, value }) => ({ diff --git a/frontend/src/services/System/SystemNativeClient/index.ts b/frontend/src/services/System/SystemNativeClient/index.ts index 15a149a7..c27770dc 100644 --- a/frontend/src/services/System/SystemNativeClient/index.ts +++ b/frontend/src/services/System/SystemNativeClient/index.ts @@ -22,8 +22,9 @@ class SystemNativeClient implements SystemClient { }); }; - public getCookie: (key: string) => string | undefined = (key) => { - return window.NativeRobosats?.cookies[key]; + public getCookie: (key: string) => string = (key) => { + const cookie = window.NativeRobosats?.cookies[key]; + return cookie === null || cookie === undefined ? '' : cookie; }; public setCookie: (key: string, value: string) => void = (key, value) => { diff --git a/frontend/src/services/System/SystemWebClient/index.ts b/frontend/src/services/System/SystemWebClient/index.ts index 2720f724..3aab1a3c 100644 --- a/frontend/src/services/System/SystemWebClient/index.ts +++ b/frontend/src/services/System/SystemWebClient/index.ts @@ -27,7 +27,7 @@ class SystemWebClient implements SystemClient { } }; - public getCookie: (key: string) => string | undefined = (key) => { + public getCookie: (key: string) => string = (key) => { let cookieValue = null; if (document.cookie && document.cookie !== '') { const cookies = document.cookie.split(';');