mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Clear all gas slice state on entering and leaving swaps (#9609)
This commit is contained in:
parent
83fe472779
commit
af018a2d74
@ -38,7 +38,7 @@ import {
|
||||
SWAP_FAILED_ERROR,
|
||||
} from '../../helpers/constants/swaps'
|
||||
import { SWAP, SWAP_APPROVAL } from '../../helpers/constants/transactions'
|
||||
import { fetchBasicGasAndTimeEstimates, fetchGasEstimates, resetCustomData } from '../gas/gas.duck'
|
||||
import { fetchBasicGasAndTimeEstimates, fetchGasEstimates, resetCustomGasState } from '../gas/gas.duck'
|
||||
import { formatCurrency } from '../../helpers/utils/confirm-tx.util'
|
||||
|
||||
const initialState = {
|
||||
@ -235,7 +235,7 @@ export const prepareForRetryGetQuotes = () => {
|
||||
|
||||
export const prepareToLeaveSwaps = () => {
|
||||
return async (dispatch) => {
|
||||
dispatch(resetCustomData())
|
||||
dispatch(resetCustomGasState())
|
||||
dispatch(clearSwapsState())
|
||||
await dispatch(resetBackgroundSwapsState())
|
||||
|
||||
|
@ -25,6 +25,7 @@ import {
|
||||
prepareToLeaveSwaps,
|
||||
fetchAndSetSwapsGasPriceInfo,
|
||||
} from '../../ducks/swaps/swaps'
|
||||
import { resetCustomGasState } from '../../ducks/gas/gas.duck'
|
||||
import {
|
||||
AWAITING_SWAP_ROUTE,
|
||||
BUILD_QUOTE_ROUTE,
|
||||
@ -159,6 +160,7 @@ export default function Swap () {
|
||||
dispatch(setMetamaskFeeAmount(metaMaskFeeAmount))
|
||||
})
|
||||
|
||||
dispatch(resetCustomGasState())
|
||||
dispatch(fetchAndSetSwapsGasPriceInfo())
|
||||
|
||||
return () => {
|
||||
|
Loading…
Reference in New Issue
Block a user