Skip to content

Commit

Permalink
Merge branch 'main' into vital/eng-4696-increase-maxlength-to-match-d…
Browse files Browse the repository at this point in the history
…escription-max-chars-in
  • Loading branch information
jonathanprozzi authored Nov 12, 2024
2 parents 37a388e + 7ac0d87 commit e8032f0
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import {
TransactionSuccessAction,
TransactionSuccessActionType,
} from 'app/types'
import { parseUnits, toHex } from 'viem'
import { decodeEventLog, parseUnits, toHex } from 'viem'
import { useAccount, usePublicClient, useWalletClient } from 'wagmi'

interface IdentityFormProps {
Expand Down Expand Up @@ -108,6 +108,7 @@ export function IdentityForm({
)
const [imageUploadError, setImageUploadError] = useState<string | null>(null)
const [initialDeposit, setInitialDeposit] = useState<string>('')
const [vaultId, setVaultId] = useState<string | undefined>(undefined)
const [transactionResponseData, setTransactionResponseData] =
useState<IdentityPresenter | null>(null)

Expand Down Expand Up @@ -310,6 +311,17 @@ export function IdentityForm({
const receipt = await publicClient.waitForTransactionReceipt({
hash: txHash,
})
const decodedLog = decodeEventLog({
abi: multivaultAbi,
data: receipt?.logs[0].data,
topics: receipt?.logs[0].topics,
})
const topics = decodedLog as unknown as {
eventName: string
args: { vaultId: string }
}

setVaultId(topics.args.vaultId.toString())
dispatch({
type: 'TRANSACTION_COMPLETE',
txHash,
Expand Down Expand Up @@ -777,9 +789,7 @@ export function IdentityForm({
className="mt-auto w-40"
onClick={() => {
if (successAction === TransactionSuccessAction.VIEW) {
navigate(
`${PATHS.IDENTITY}/${transactionResponseData.vault_id}`,
)
navigate(`${PATHS.IDENTITY}/${vaultId}`)
}
handleClose()
}}
Expand Down

0 comments on commit e8032f0

Please sign in to comment.