mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 10:56:24 +00:00
Merge pull request #1360 from RoboSats/fix-build-in-calls
Fix build-it in
This commit is contained in:
commit
a6573ba416
@ -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,
|
||||
|
@ -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'>
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user