mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-29 02:18:06 +00:00
Added action
This commit is contained in:
parent
4b55bde476
commit
fc50202f6a
@ -384,6 +384,23 @@ export const onDataChange = (data: string): ThunkAction => (dispatch: Dispatch,
|
|||||||
dispatch(estimateGasPrice());
|
dispatch(estimateGasPrice());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const setDefaultGasLimit = (): ThunkAction => (dispatch: Dispatch, getState: GetState): void => {
|
||||||
|
const state: State = getState().sendForm;
|
||||||
|
const { network } = getState().selectedAccount;
|
||||||
|
if (!network) return;
|
||||||
|
|
||||||
|
dispatch({
|
||||||
|
type: SEND.CHANGE,
|
||||||
|
state: {
|
||||||
|
...state,
|
||||||
|
calculatingGasLimit: false,
|
||||||
|
untouched: false,
|
||||||
|
touched: { ...state.touched, gasLimit: true },
|
||||||
|
gasLimit: network.defaultGasLimit.toString(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Internal method
|
* Internal method
|
||||||
* Called from "onDataChange" action
|
* Called from "onDataChange" action
|
||||||
@ -548,6 +565,7 @@ export default {
|
|||||||
updateFeeLevels,
|
updateFeeLevels,
|
||||||
onGasPriceChange,
|
onGasPriceChange,
|
||||||
onGasLimitChange,
|
onGasLimitChange,
|
||||||
|
setDefaultGasLimit,
|
||||||
onNonceChange,
|
onNonceChange,
|
||||||
onDataChange,
|
onDataChange,
|
||||||
onSend,
|
onSend,
|
||||||
|
@ -143,11 +143,11 @@ const AdvancedForm = (props: Props) => {
|
|||||||
gasPrice,
|
gasPrice,
|
||||||
} = props.sendForm;
|
} = props.sendForm;
|
||||||
const {
|
const {
|
||||||
|
setDefaultGasLimit,
|
||||||
onGasLimitChange,
|
onGasLimitChange,
|
||||||
onGasPriceChange,
|
onGasPriceChange,
|
||||||
onDataChange,
|
onDataChange,
|
||||||
} = props.sendFormActions;
|
} = props.sendFormActions;
|
||||||
|
|
||||||
let gasLimitTooltipCurrency: string;
|
let gasLimitTooltipCurrency: string;
|
||||||
let gasLimitTooltipValue: string;
|
let gasLimitTooltipValue: string;
|
||||||
if (networkSymbol !== currency) {
|
if (networkSymbol !== currency) {
|
||||||
@ -190,8 +190,8 @@ const AdvancedForm = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Left>
|
</Left>
|
||||||
<Right>
|
<Right onClick={() => setDefaultGasLimit()}>
|
||||||
Set default
|
Set default
|
||||||
</Right>
|
</Right>
|
||||||
</InputLabelWrapper>
|
</InputLabelWrapper>
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user