Skip to content

Commit

Permalink
Ensure previousGas is use on retry transaction if it is available in …
Browse files Browse the repository at this point in the history
…useGasFeeInputs
  • Loading branch information
danjm committed Apr 12, 2022
1 parent 9e173c8 commit 0a32bcb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/hooks/gasFeeInput/useGasFeeInputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,19 @@ export function useGasFeeInputs(
minimumGasLimit = '0x5208',
editGasMode = EDIT_GAS_MODES.MODIFY_IN_PLACE,
) {
const [retryTxMeta, setRetryTxMeta] = useState({
const initialRetryTxMeta = {
txParams: _transaction?.txParams,
id: _transaction?.id,
userFeeLevel: _transaction?.userFeeLevel,
originalGasEstimate: _transaction?.originalGasEstimate,
userEditedGasLimit: _transaction?.userEditedGasLimit,
});
};

if (_transaction?.previousGas) {
initialRetryTxMeta.previousGas = _transaction?.previousGas;
}

const [retryTxMeta, setRetryTxMeta] = useState(initialRetryTxMeta);

const transaction = editGasModeIsSpeedUpOrCancel(editGasMode)
? retryTxMeta
Expand Down

0 comments on commit 0a32bcb

Please sign in to comment.