mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-10 16:21:36 +00:00
Small fixes
This commit is contained in:
parent
0ce3aff484
commit
7c2f6e1659
@ -132,6 +132,7 @@ const BookPage = ({
|
||||
setPage('order');
|
||||
history.push('/order/' + id);
|
||||
}}
|
||||
baseUrl={baseUrl}
|
||||
/>
|
||||
</Box>
|
||||
</Dialog>
|
||||
|
@ -107,7 +107,7 @@ const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
||||
window.removeEventListener('resize', onResize);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
}, [baseUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
let host = '';
|
||||
@ -316,6 +316,7 @@ const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
||||
setFav={setFav}
|
||||
windowSize={{ ...windowSize, height: windowSize.height - navbarHeight }}
|
||||
hasRobot={robot.avatarLoaded}
|
||||
baseUrl={baseUrl}
|
||||
/>
|
||||
</div>
|
||||
</Slide>
|
||||
|
@ -24,6 +24,7 @@ interface MakerPageProps {
|
||||
hasRobot: boolean;
|
||||
setCurrentOrder: (state: number) => void;
|
||||
setPage: (state: Page) => void;
|
||||
baseUrl: string;
|
||||
}
|
||||
|
||||
const MakerPage = ({
|
||||
@ -38,6 +39,7 @@ const MakerPage = ({
|
||||
setCurrentOrder,
|
||||
setPage,
|
||||
hasRobot = false,
|
||||
baseUrl,
|
||||
}: MakerPageProps): JSX.Element => {
|
||||
const { t } = useTranslation();
|
||||
const history = useHistory();
|
||||
@ -108,6 +110,7 @@ const MakerPage = ({
|
||||
onReset={() => setShowMatches(false)}
|
||||
submitButtonLabel={matches.length > 0 && !showMatches ? 'Submit' : 'Create order'}
|
||||
setPage={setPage}
|
||||
baseUrl={baseUrl}
|
||||
/>
|
||||
</Paper>
|
||||
</Grid>
|
||||
|
@ -29,9 +29,8 @@ import { LimitList, Maker, Favorites, defaultMaker } from '../../models';
|
||||
import { LocalizationProvider, TimePicker } from '@mui/x-date-pickers';
|
||||
import DateFnsUtils from '@date-io/date-fns';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { StoreTokenDialog, NoRobotDialog, ConfirmationDialog } from '../Dialogs';
|
||||
import { ConfirmationDialog } from '../Dialogs';
|
||||
import { apiClient } from '../../services/api';
|
||||
import { systemClient } from '../../services/System';
|
||||
|
||||
import { FlagWithProps } from '../Icons';
|
||||
import AutocompletePayments from './AutocompletePayments';
|
||||
@ -59,6 +58,7 @@ interface MakerFormProps {
|
||||
onOrderCreated?: (id: number) => void;
|
||||
hasRobot?: boolean;
|
||||
setPage?: (state: Page) => void;
|
||||
baseUrl: string;
|
||||
}
|
||||
|
||||
const MakerForm = ({
|
||||
@ -77,6 +77,7 @@ const MakerForm = ({
|
||||
onOrderCreated = () => null,
|
||||
hasRobot = true,
|
||||
setPage = () => null,
|
||||
baseUrl,
|
||||
}: MakerFormProps): JSX.Element => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
@ -263,7 +264,7 @@ const MakerForm = ({
|
||||
escrow_duration: maker.escrowDuration,
|
||||
bond_size: maker.bondSize,
|
||||
};
|
||||
apiClient.post('/api/make/', body).then((data: object) => {
|
||||
apiClient.post(baseUrl, '/api/make/', body).then((data: object) => {
|
||||
setBadRequest(data.bad_request);
|
||||
if (data.id) {
|
||||
onOrderCreated(data.id);
|
||||
|
@ -150,7 +150,10 @@ const SettingsForm = ({
|
||||
<ToggleButtonGroup
|
||||
exclusive={true}
|
||||
value={settings.network}
|
||||
onChange={(e, network) => setSettings({ ...settings, network })}
|
||||
onChange={(e, network) => {
|
||||
setSettings({ ...settings, network });
|
||||
systemClient.setCookie('settings_network', network);
|
||||
}}
|
||||
>
|
||||
<ToggleButton value='mainnet' color='primary'>
|
||||
{t('Mainnet')}
|
||||
|
@ -37,6 +37,9 @@ class BaseSettings {
|
||||
: i18n.resolvedLanguage == null
|
||||
? 'en'
|
||||
: i18n.resolvedLanguage.substring(0, 2);
|
||||
|
||||
const networkCookie = systemClient.getCookie('settings_network');
|
||||
this.network = networkCookie !== '' ? networkCookie : 'mainnet';
|
||||
}
|
||||
|
||||
public frontend: 'basic' | 'pro' = 'basic';
|
||||
@ -44,7 +47,7 @@ class BaseSettings {
|
||||
public fontSize: number = 14;
|
||||
public language?: Language;
|
||||
public freezeViewports: boolean = false;
|
||||
public network: 'mainnet' | 'testnet' | undefined = 'testnet';
|
||||
public network: 'mainnet' | 'testnet' | undefined = 'mainnet';
|
||||
public coordinator: Coordinator | undefined = undefined;
|
||||
public host?: string;
|
||||
public unsafeClient: boolean = false;
|
||||
|
@ -50,6 +50,7 @@ const App = () => {
|
||||
loadCookie('settings_fontsize_basic');
|
||||
loadCookie('settings_language');
|
||||
loadCookie('settings_mode');
|
||||
loadCookie('settings_network');
|
||||
loadCookie('enc_priv_key').then(() => injectMessageResolve(reponseId));
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user