Skip to content

Commit

Permalink
Merge pull request #1360 from RoboSats/fix-build-in-calls
Browse files Browse the repository at this point in the history
Fix build-it in
  • Loading branch information
KoalaSat authored Jun 30, 2024
2 parents 1757a97 + db4cac7 commit a6573ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/MakerForm/AutocompletePayments.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/SettingsForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/services/api/ApiNativeClient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit a6573ba

Please sign in to comment.