@ -23,6 +23,8 @@ import {
updateTransaction ,
resetBackgroundSwapsState ,
setSwapsLiveness ,
setSelectedQuoteAggId ,
setSwapsTxGasLimit ,
} from '../../store/actions'
import {
AWAITING _SWAP _ROUTE ,
@ -95,6 +97,8 @@ const slice = createSlice({
state . approveTxId = null
state . balanceError = false
state . fetchingQuotes = false
state . customGas . limit = null
state . customGas . price = null
} ,
retriedGetQuotes : ( state ) => {
state . approveTxId = null
@ -122,6 +126,10 @@ const slice = createSlice({
setToToken : ( state , action ) => {
state . toToken = action . payload
} ,
swapCustomGasModalClosed : ( state ) => {
state . customGas . price = null
state . customGas . limit = null
} ,
swapCustomGasModalPriceEdited : ( state , action ) => {
state . customGas . price = action . payload
} ,
@ -299,6 +307,7 @@ const {
swapCustomGasModalPriceEdited ,
swapCustomGasModalLimitEdited ,
retrievedFallbackSwapsGasPrice ,
swapCustomGasModalClosed ,
} = actions
export {
@ -312,6 +321,7 @@ export {
setToToken as setSwapToToken ,
swapCustomGasModalPriceEdited ,
swapCustomGasModalLimitEdited ,
swapCustomGasModalClosed ,
}
export const navigateBackToBuildQuote = ( history ) => {
@ -339,6 +349,14 @@ export const prepareToLeaveSwaps = () => {
}
}
export const swapsQuoteSelected = ( aggId ) => {
return ( dispatch ) => {
dispatch ( swapCustomGasModalLimitEdited ( null ) )
dispatch ( setSelectedQuoteAggId ( aggId ) )
dispatch ( setSwapsTxGasLimit ( '' ) )
}
}
export const fetchAndSetSwapsGasPriceInfo = ( ) => {
return async ( dispatch ) => {
const basicEstimates = await dispatch ( fetchMetaSwapsGasPriceEstimates ( ) )