Skip to content

Commit

Permalink
optionals to prevent crashing (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobar79 authored Jul 6, 2023
1 parent 3404d4a commit 9cf5a89
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export function SendTransactionInfo({ request }: SendTransactionProps) {
});
const { appSession } = useAppSession({ host: appHost });
const { flashbotsEnabled } = useFlashbotsEnabledStore();
const nativeAsset = useNativeAssetForNetwork({ chainId: appSession.chainId });
const nativeAsset = useNativeAssetForNetwork({
chainId: appSession?.chainId || ChainId.mainnet,
});
const { currentCurrency } = useCurrentCurrencyStore();
const flashbotsEnabledGlobally =
config.flashbots_enabled &&
Expand All @@ -42,7 +44,7 @@ export function SendTransactionInfo({ request }: SendTransactionProps) {
const { data: methodName = '' } = useRegistryLookup({
data: (txRequest?.data as string) || null,
to: txRequest?.to || null,
chainId: appSession.chainId,
chainId: appSession?.chainId || ChainId.mainnet,
hash: null,
});

Expand Down Expand Up @@ -144,7 +146,7 @@ export function SendTransactionInfo({ request }: SendTransactionProps) {
transactionSpeedClicked:
event.dappPromptSendTransactionSpeedClicked,
}}
chainId={appSession.chainId}
chainId={appSession?.chainId || ChainId.mainnet}
transactionRequest={request?.params?.[0] as TransactionRequest}
plainTriggerBorder
flashbotsEnabled={flashbotsEnabledGlobally}
Expand Down

0 comments on commit 9cf5a89

Please sign in to comment.