Skip to content

Commit

Permalink
Fix useDynamicSafeAction not picking correct context
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopv committed Nov 6, 2024
1 parent 52a2f1e commit 79fed23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useDynamicSafeAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
useConfirmTransaction,
UseConfirmTransactionReturnType
} from '@/hooks/useConfirmTransaction.js'
import { useConfig } from './useConfig.js'

export type UseDynamicSafeActionParams = ConfigParam<SafeConfigWithSigner>

Expand All @@ -33,7 +34,9 @@ export type UseDynamicSafeActionReturnType = {
export function useDynamicSafeAction(
params: UseDynamicSafeActionParams = {}
): UseDynamicSafeActionReturnType {
const isSafeOperation = !!params.config?.safeOperationOptions
const [config] = useConfig({ config: params.config })

const isSafeOperation = !!config?.safeOperationOptions

// Use the appropriate hooks based on the presence of safeOperations in the config
const { sendSafeOperation, sendSafeOperationAsync }: UseSendSafeOperationReturnType =
Expand Down

0 comments on commit 79fed23

Please sign in to comment.