diff --git a/frontend/src/components/MakerForm/AutocompletePayments.tsx b/frontend/src/components/MakerForm/AutocompletePayments.tsx index 642151e3..9d23504d 100644 --- a/frontend/src/components/MakerForm/AutocompletePayments.tsx +++ b/frontend/src/components/MakerForm/AutocompletePayments.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { useAutocomplete } from '@mui/base/useAutocomplete'; +import useAutocomplete from '@mui/base/useAutocomplete'; import { styled } from '@mui/material/styles'; import { Button, diff --git a/frontend/src/components/SettingsForm/index.tsx b/frontend/src/components/SettingsForm/index.tsx index 90f96981..0c81dbe1 100644 --- a/frontend/src/components/SettingsForm/index.tsx +++ b/frontend/src/components/SettingsForm/index.tsx @@ -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 }} > diff --git a/frontend/src/services/api/ApiNativeClient/index.ts b/frontend/src/services/api/ApiNativeClient/index.ts index 93f8ba39..afc1b51a 100644 --- a/frontend/src/services/api/ApiNativeClient/index.ts +++ b/frontend/src/services/api/ApiNativeClient/index.ts @@ -55,7 +55,7 @@ class ApiNativeClient implements ApiClient { public delete: (baseUrl: string, path: string, auth?: Auth) => Promise = 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 = 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',