File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
apps/cowswap-frontend/src/modules/trade/containers/TradeWidget Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,12 @@ export function TradeWidgetModals({
5454 const updateTradeApproveState = useUpdateTradeApproveState ( )
5555
5656 const resetAllScreens = useCallback (
57- ( closeTokenSelectWidget = true ) => {
57+ ( closeTokenSelectWidget = true , shouldCloseAutoImportModal = true ) => {
5858 closeTradeConfirm ( )
5959 closeZeroApprovalModal ( )
60- closeAutoImportModal ( )
60+ if ( shouldCloseAutoImportModal ) {
61+ closeAutoImportModal ( )
62+ }
6163 if ( closeTokenSelectWidget ) {
6264 updateSelectTokenWidgetState ( { open : false } )
6365 }
@@ -79,11 +81,11 @@ export function TradeWidgetModals({
7981 const error = tokenListAddingError || approveError || confirmError
8082
8183 /**
82- * Close modals on chainId/ account change
84+ * Close all modals besides auto-import on account change
8385 */
8486 useEffect ( ( ) => {
85- resetAllScreens ( )
86- } , [ chainId , account , resetAllScreens ] )
87+ resetAllScreens ( true , false )
88+ } , [ account , resetAllScreens ] )
8789
8890 /**
8991 * Close all modals besides token select widget on chain change
You can’t perform that action at this time.
0 commit comments