Attempt to fix Android cookies

This commit is contained in:
Reckless_Satoshi 2022-11-01 13:29:08 -07:00
parent fa8f31981e
commit 059c52b370
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 8 additions and 4 deletions

View File

@ -129,7 +129,10 @@ const SettingsForm = ({
onChange={(e) => { onChange={(e) => {
const fontSize = e.target.value; const fontSize = e.target.value;
setSettings({ ...settings, fontSize }); setSettings({ ...settings, fontSize });
systemClient.setCookie(`settings_fontsize_${settings.frontend}`, fontSize); systemClient.setCookie(
`settings_fontsize_${settings.frontend}`,
fontSize.toString(),
);
}} }}
valueLabelDisplay='off' valueLabelDisplay='off'
marks={fontSizes.map(({ label, value }) => ({ marks={fontSizes.map(({ label, value }) => ({

View File

@ -22,8 +22,9 @@ class SystemNativeClient implements SystemClient {
}); });
}; };
public getCookie: (key: string) => string | undefined = (key) => { public getCookie: (key: string) => string = (key) => {
return window.NativeRobosats?.cookies[key]; const cookie = window.NativeRobosats?.cookies[key];
return cookie === null || cookie === undefined ? '' : cookie;
}; };
public setCookie: (key: string, value: string) => void = (key, value) => { public setCookie: (key: string, value: string) => void = (key, value) => {

View File

@ -27,7 +27,7 @@ class SystemWebClient implements SystemClient {
} }
}; };
public getCookie: (key: string) => string | undefined = (key) => { public getCookie: (key: string) => string = (key) => {
let cookieValue = null; let cookieValue = null;
if (document.cookie && document.cookie !== '') { if (document.cookie && document.cookie !== '') {
const cookies = document.cookie.split(';'); const cookies = document.cookie.split(';');