-
- {t('nonceFieldHeading')}
-
-
- {
- if (!value.length || Number(value) < 0) {
- updateCustomNonce('');
- } else {
- updateCustomNonce(String(Math.floor(value)));
- }
- getNextNonce();
- }}
- fullWidth
- margin="dense"
- value={customNonceValue || ''}
- />
-
+ const nextNonceValue =
+ typeof nextNonce === 'number' ? nextNonce.toString() : null;
+ const renderNonceField = useNonceField && !isSigningOrSubmitting;
+
+ if (renderNonceField && !customNonceValue && nextNonceValue) {
+ updateCustomNonce(nextNonceValue);
+ }
+
+ const nonceField = renderNonceField ? (
+
+
+
+ {t('nonceFieldHeading')}
+
+
+
- ) : null;
+
+ ) : null;
const { simulationData } = txData;
diff --git a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.test.js b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.test.js
index 393280aee3f1..f8a7b40430fb 100644
--- a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.test.js
+++ b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.test.js
@@ -163,6 +163,8 @@ const baseStore = {
tokenList: {},
ensResolutionsByAddress: {},
snaps: {},
+ useNonceField: true,
+ customNonceValue: '70',
},
confirmTransaction: {
txData: {