Fix build-it in

This commit is contained in:
koalasat 2024-06-30 23:18:56 +02:00
parent 1757a9781a
commit b136f9d7e5
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157
2 changed files with 5 additions and 3 deletions

View File

@ -33,6 +33,7 @@ import { TorIcon } from '../Icons';
import SwapCalls from '@mui/icons-material/SwapCalls';
import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext';
import { GarageContext, UseGarageStoreType } from '../../contexts/GarageContext';
import { apiClient } from '../../services/api';
interface SettingsFormProps {
dense?: boolean;
@ -252,6 +253,7 @@ const SettingsForm = ({ dense = false }: SettingsFormProps): JSX.Element => {
onChange={(_e, useProxy) => {
setSettings({ ...settings, useProxy });
systemClient.setItem('settings_use_proxy', String(useProxy));
apiClient.useProxy = useProxy
}}
>
<ToggleButton value={true} color='primary'>

View File

@ -55,7 +55,7 @@ class ApiNativeClient implements ApiClient {
public delete: (baseUrl: string, path: string, auth?: Auth) => Promise<object | undefined> =
async (baseUrl, path, auth) => {
if (!this.proxy) this.webClient.delete(baseUrl, path, auth);
if (!this.useProxy) return this.webClient.delete(baseUrl, path, auth);
return await window.NativeRobosats?.postMessage({
category: 'http',
type: 'delete',
@ -71,7 +71,7 @@ class ApiNativeClient implements ApiClient {
body: object,
auth?: Auth,
) => Promise<object | undefined> = async (baseUrl, path, body, auth) => {
if (!this.proxy) this.webClient.post(baseUrl, path, body, auth);
if (!this.useProxy) return this.webClient.post(baseUrl, path, body, auth);
return await window.NativeRobosats?.postMessage({
category: 'http',
type: 'post',
@ -87,7 +87,7 @@ class ApiNativeClient implements ApiClient {
path,
auth,
) => {
if (!this.proxy) this.webClient.get(baseUrl, path, auth);
if (!this.useProxy) return this.webClient.get(baseUrl, path, auth);
return await window.NativeRobosats?.postMessage({
category: 'http',
type: 'get',