Fix settings save

This commit is contained in:
KoalaSat
2024-06-04 16:35:31 +02:00
parent e4a8f31ee5
commit 4a583b78e8
4 changed files with 3 additions and 6 deletions

View File

@ -43,13 +43,11 @@ class BaseSettings {
: i18n.resolvedLanguage.substring(0, 2); : i18n.resolvedLanguage.substring(0, 2);
const networkCookie = systemClient.getItem('settings_network'); const networkCookie = systemClient.getItem('settings_network');
this.network = networkCookie && networkCookie !== '' ? networkCookie : 'mainnet'; this.network = networkCookie && networkCookie !== '' ? networkCookie : 'mainnet';
this.host = getHost(); this.host = getHost();
const useProxy = systemClient.getItem('settings_use_proxy'); const useProxy = systemClient.getItem('settings_use_proxy');
this.useProxy = this.useProxy = window.NativeRobosats !== undefined && useProxy !== 'false';
useProxy === 'true' || (useProxy !== 'false' && window.NativeRobosats !== undefined);
apiClient.useProxy = this.useProxy; apiClient.useProxy = this.useProxy;
} }

View File

@ -28,7 +28,7 @@ class SystemNativeClient implements SystemClient {
}; };
public setCookie: (key: string, value: string) => void = (key, value) => { public setCookie: (key: string, value: string) => void = (key, value) => {
delete window.NativeRobosats?.cookies[key]; window.NativeRobosats?.loadCookie({ key, value });
void window.NativeRobosats?.postMessage({ void window.NativeRobosats?.postMessage({
category: 'system', category: 'system',
type: 'setCookie', type: 'setCookie',

View File

@ -45,7 +45,6 @@ export default function federationLottery(federation: Federation): string[] {
// federation[shortAlias] = { badges:{ donatesToDevFund }}; // federation[shortAlias] = { badges:{ donatesToDevFund }};
// } // }
// console.log(federation)
// return federation; // return federation;
// } // }
@ -58,5 +57,4 @@ export default function federationLottery(federation: Federation): string[] {
// results.push(rankedCoordinators); // results.push(rankedCoordinators);
// } // }
// console.log(results)
// } // }

View File

@ -71,6 +71,7 @@ const App = () => {
loadCookie('settings_mode'); loadCookie('settings_mode');
loadCookie('settings_light_qr'); loadCookie('settings_light_qr');
loadCookie('settings_network'); loadCookie('settings_network');
loadCookie('settings_use_proxy');
loadCookie('garage_slots').then(() => injectMessageResolve(responseId)); loadCookie('garage_slots').then(() => injectMessageResolve(responseId));
}; };