aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2019-03-07 00:19:57 +0800
committerGitHub <noreply@github.com>2019-03-07 00:19:57 +0800
commitf74cd1aa3f78004d0393cfd0d1c89e73804106ac (patch)
tree16b2ab6d58c4e601f394a48159070fe575e73639
parentd547e0b80bc98893993ece2ff4058e18f5ac6914 (diff)
downloadtangerine-wallet-browser-f74cd1aa3f78004d0393cfd0d1c89e73804106ac.tar
tangerine-wallet-browser-f74cd1aa3f78004d0393cfd0d1c89e73804106ac.tar.gz
tangerine-wallet-browser-f74cd1aa3f78004d0393cfd0d1c89e73804106ac.tar.bz2
tangerine-wallet-browser-f74cd1aa3f78004d0393cfd0d1c89e73804106ac.tar.lz
tangerine-wallet-browser-f74cd1aa3f78004d0393cfd0d1c89e73804106ac.tar.xz
tangerine-wallet-browser-f74cd1aa3f78004d0393cfd0d1c89e73804106ac.tar.zst
tangerine-wallet-browser-f74cd1aa3f78004d0393cfd0d1c89e73804106ac.zip
Prevent advanced gas input arrows from setting value to < 0 (#6248)
-rw-r--r--ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js14
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js14
2 files changed, 24 insertions, 4 deletions
diff --git a/ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js b/ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js
index f0abff478..95894140c 100644
--- a/ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js
+++ b/ui/app/components/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js
@@ -80,8 +80,18 @@ export default class AdvancedTabContent extends Component {
'advanced-gas-inputs__gas-edit-row__input--error': isInError && errorType === 'error',
'advanced-gas-inputs__gas-edit-row__input--warning': isInError && errorType === 'warning',
})}>
- <div className="advanced-gas-inputs__gas-edit-row__input-arrows__i-wrap" onClick={() => onChange(value + 1)}><i className="fa fa-sm fa-angle-up" /></div>
- <div className="advanced-gas-inputs__gas-edit-row__input-arrows__i-wrap" onClick={() => onChange(value - 1)}><i className="fa fa-sm fa-angle-down" /></div>
+ <div
+ className="advanced-gas-inputs__gas-edit-row__input-arrows__i-wrap"
+ onClick={() => onChange(value + 1)}
+ >
+ <i className="fa fa-sm fa-angle-up" />
+ </div>
+ <div
+ className="advanced-gas-inputs__gas-edit-row__input-arrows__i-wrap"
+ onClick={() => onChange(Math.max(value - 1, 0))}
+ >
+ <i className="fa fa-sm fa-angle-down" />
+ </div>
</div>
{ isInError
? <div className={`advanced-gas-inputs__gas-edit-row__${errorType}-text`}>
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js b/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
index 366ad88c9..a3a3f96d8 100644
--- a/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
+++ b/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
@@ -88,8 +88,18 @@ export default class AdvancedTabContent extends Component {
'advanced-tab__gas-edit-row__input--error': isInError && errorType === 'error',
'advanced-tab__gas-edit-row__input--warning': isInError && errorType === 'warning',
})}>
- <div className="advanced-tab__gas-edit-row__input-arrows__i-wrap" onClick={() => onChange(value + 1)}><i className="fa fa-sm fa-angle-up" /></div>
- <div className="advanced-tab__gas-edit-row__input-arrows__i-wrap" onClick={() => onChange(value - 1)}><i className="fa fa-sm fa-angle-down" /></div>
+ <div
+ className="advanced-tab__gas-edit-row__input-arrows__i-wrap"
+ onClick={() => onChange(value + 1)}
+ >
+ <i className="fa fa-sm fa-angle-up" />
+ </div>
+ <div
+ className="advanced-tab__gas-edit-row__input-arrows__i-wrap"
+ onClick={() => onChange(Math.max(value - 1, 0))}
+ >
+ <i className="fa fa-sm fa-angle-down" />
+ </div>
</div>
{ isInError
? <div className={`advanced-tab__gas-edit-row__${errorType}-text`}>