Close Add Market modal on Cancel

This commit is contained in:
Austin Chen 2022-08-26 12:41:29 -07:00
parent 490115d890
commit ba7d0f45db

View File

@ -48,8 +48,17 @@ export function MarketModal(props: {
{contracts.length > 1 && 's'}
</Button>
)}
<Button onClick={() => setContracts([])} color="gray">
Cancel
<Button
onClick={() => {
if (contracts.length > 0) {
setContracts([])
} else {
setOpen(false)
}
}}
color="gray"
>
{contracts.length > 0 ? 'Reset' : 'Cancel'}
</Button>
</Row>
)}