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,
|
SWAP_FAILED_ERROR,
|
||||||
} from '../../helpers/constants/swaps'
|
} from '../../helpers/constants/swaps'
|
||||||
import { SWAP, SWAP_APPROVAL } from '../../helpers/constants/transactions'
|
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'
|
import { formatCurrency } from '../../helpers/utils/confirm-tx.util'
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
@ -235,7 +235,7 @@ export const prepareForRetryGetQuotes = () => {
|
|||||||
|
|
||||||
export const prepareToLeaveSwaps = () => {
|
export const prepareToLeaveSwaps = () => {
|
||||||
return async (dispatch) => {
|
return async (dispatch) => {
|
||||||
dispatch(resetCustomData())
|
dispatch(resetCustomGasState())
|
||||||
dispatch(clearSwapsState())
|
dispatch(clearSwapsState())
|
||||||
await dispatch(resetBackgroundSwapsState())
|
await dispatch(resetBackgroundSwapsState())
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import {
|
|||||||
prepareToLeaveSwaps,
|
prepareToLeaveSwaps,
|
||||||
fetchAndSetSwapsGasPriceInfo,
|
fetchAndSetSwapsGasPriceInfo,
|
||||||
} from '../../ducks/swaps/swaps'
|
} from '../../ducks/swaps/swaps'
|
||||||
|
import { resetCustomGasState } from '../../ducks/gas/gas.duck'
|
||||||
import {
|
import {
|
||||||
AWAITING_SWAP_ROUTE,
|
AWAITING_SWAP_ROUTE,
|
||||||
BUILD_QUOTE_ROUTE,
|
BUILD_QUOTE_ROUTE,
|
||||||
@ -159,6 +160,7 @@ export default function Swap () {
|
|||||||
dispatch(setMetamaskFeeAmount(metaMaskFeeAmount))
|
dispatch(setMetamaskFeeAmount(metaMaskFeeAmount))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
dispatch(resetCustomGasState())
|
||||||
dispatch(fetchAndSetSwapsGasPriceInfo())
|
dispatch(fetchAndSetSwapsGasPriceInfo())
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user