mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Prevent React warning for custom slippage (#9706)
This commit is contained in:
parent
d0d7a3d01f
commit
5b67cf1009
@ -74,7 +74,7 @@ export default function SlippageButtons ({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCustomValue(undefined)
|
setCustomValue('')
|
||||||
setEnteringCustomValue(false)
|
setEnteringCustomValue(false)
|
||||||
setActiveButtonIndex(1)
|
setActiveButtonIndex(1)
|
||||||
onSelect(2)
|
onSelect(2)
|
||||||
@ -108,12 +108,12 @@ export default function SlippageButtons ({
|
|||||||
ref={setInputRef}
|
ref={setInputRef}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
setEnteringCustomValue(false)
|
setEnteringCustomValue(false)
|
||||||
if (customValue === '' || customValue === '0') {
|
if (customValue === '0') {
|
||||||
setCustomValue(null)
|
setCustomValue('')
|
||||||
setActiveButtonIndex(1)
|
setActiveButtonIndex(1)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
value={customValue}
|
value={customValue || ''}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user