Prevent React warning for custom slippage (#9706)

feature/default_network_editable
David Walsh 4 years ago committed by GitHub
parent d0d7a3d01f
commit 5b67cf1009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ui/app/pages/swaps/slippage-buttons/slippage-buttons.js

@ -74,7 +74,7 @@ export default function SlippageButtons ({
</Button>
<Button
onClick={() => {
setCustomValue(undefined)
setCustomValue('')
setEnteringCustomValue(false)
setActiveButtonIndex(1)
onSelect(2)
@ -108,12 +108,12 @@ export default function SlippageButtons ({
ref={setInputRef}
onBlur={() => {
setEnteringCustomValue(false)
if (customValue === '' || customValue === '0') {
setCustomValue(null)
if (customValue === '0') {
setCustomValue('')
setActiveButtonIndex(1)
}
}}
value={customValue}
value={customValue || ''}
/>
</div>
)

Loading…
Cancel
Save