From 67b554b62c815b07fe22ff2681ce5dafe39614c4 Mon Sep 17 00:00:00 2001 From: Achraf Eddaqqaq <51858084+aeddaqqa@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:28:52 +0100 Subject: [PATCH] add navigate function to create offer form params (#171) * add navigate function to create offer form params * fix catch fetching multisig aliases error --- src/api/index.ts | 8 ++++++-- src/views/partners/CreateOfferForm.tsx | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 5bc8e300..f54787d2 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -9,6 +9,10 @@ export const getChains = createAsyncThunk('appConfig/chains', async () => { }) export async function getMultisigAliases(ownersAddresses: string[]): Promise { - let res = await axios.get(`${getBaseUrl()}/v2/multisigalias/${ownersAddresses.join(',')}`) - return res.data.alias + try { + let res = await axios.get(`${getBaseUrl()}/v2/multisigalias/${ownersAddresses.join(',')}`) + return res.data.alias + } catch (e) { + return [] + } } diff --git a/src/views/partners/CreateOfferForm.tsx b/src/views/partners/CreateOfferForm.tsx index 6fe50d98..4f993569 100644 --- a/src/views/partners/CreateOfferForm.tsx +++ b/src/views/partners/CreateOfferForm.tsx @@ -1,10 +1,15 @@ import React, { useEffect, useRef } from 'react' +import { useNavigate } from 'react-router' import { mountCreateOfferForm } from 'wallet/mountCreateOfferForm' const LoadCreateOfferForm = () => { const ref = useRef(null) + const navigate = useNavigate() useEffect(() => { - mountCreateOfferForm(ref.current, { isSuite: true }) + mountCreateOfferForm(ref.current, { + isSuite: true, + navigate: location => navigate(location), + }) }, []) return (