1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Prevent React warning for custom slippage (#9706)

This commit is contained in:
David Walsh 2020-10-28 08:58:31 -05:00 committed by GitHub
parent d0d7a3d01f
commit 5b67cf1009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>
)