From 74223812cdf4abafdf1b08717a3d6c851b3f6bed Mon Sep 17 00:00:00 2001 From: Martin Homola Date: Tue, 11 Feb 2025 09:59:37 +0100 Subject: [PATCH] fixup! chore(trading): add buy middleware and thunks --- suite-common/trading/src/thunks/tradingThunks.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/suite-common/trading/src/thunks/tradingThunks.ts b/suite-common/trading/src/thunks/tradingThunks.ts index 0c9b55cf05e..c716d1ca32d 100644 --- a/suite-common/trading/src/thunks/tradingThunks.ts +++ b/suite-common/trading/src/thunks/tradingThunks.ts @@ -1,7 +1,4 @@ -import { createAction } from '@reduxjs/toolkit'; - import { createThunk } from '@suite-common/redux-utils'; -import { UserContextPayload } from '@suite-common/suite-types'; import { notificationsActions } from '@suite-common/toast-notifications'; import { confirmAddressOnDeviceThunk, selectSelectedDevice } from '@suite-common/wallet-core'; import { Account, AddressDisplayOptions } from '@suite-common/wallet-types'; @@ -13,10 +10,6 @@ import { getUnusedAddressFromAccount } from '../utils'; const TRADING_COMMON_PREFIX = '@trading-common/thunk'; -const openModal = createAction('@modal/open-user-context', (payload: UserContextPayload) => ({ - payload, -})); - interface VerifyAddressThunk { account: Account; address: string | undefined; @@ -29,7 +22,7 @@ const verifyAddressThunk = createThunk( `${TRADING_COMMON_PREFIX}/verifyAddress`, async ( { account, address, path, tradingAction }: VerifyAddressThunk, - { dispatch, getState }, + { dispatch, getState, extra }, ) => { const device = selectSelectedDevice(getState()); if (!device || !account) return; @@ -47,7 +40,7 @@ const verifyAddressThunk = createThunk( // Show warning when device is not connected if (!connected || !available) { dispatch( - openModal({ + extra.actions.openModal({ type: 'unverified-address-proceed', value: address, }),