Skip to content

Commit

Permalink
add navigate function to create offer form params (#171)
Browse files Browse the repository at this point in the history
* add navigate function to create offer form params

* fix catch fetching multisig aliases error
  • Loading branch information
aeddaqqa authored Nov 20, 2023
1 parent 4fc5da4 commit 67b554b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export const getChains = createAsyncThunk('appConfig/chains', async () => {
})

export async function getMultisigAliases(ownersAddresses: string[]): Promise<string[]> {
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 []
}
}
7 changes: 6 additions & 1 deletion src/views/partners/CreateOfferForm.tsx
Original file line number Diff line number Diff line change
@@ -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),
})
}, [])

Check warning on line 13 in src/views/partners/CreateOfferForm.tsx

View workflow job for this annotation

GitHub Actions / yarn-build

React Hook useEffect has a missing dependency: 'navigate'. Either include it or remove the dependency array

return (
Expand Down

0 comments on commit 67b554b

Please sign in to comment.