a
This commit is contained in:
parent
c28400e51e
commit
9bc73b63a3
|
|
@ -33,12 +33,14 @@ const AccountSelector = ({ onChanged }) => {
|
|||
return acc
|
||||
}, [])
|
||||
|
||||
const optionsKey = options.map((x) => x.id).join(',')
|
||||
|
||||
useEffect(() => {
|
||||
if (!options.length) return
|
||||
if (options.some((a) => a.id === accountId)) return
|
||||
setAccountId(options[0].id)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [options.length])
|
||||
}, [optionsKey, accountId])
|
||||
|
||||
return (
|
||||
<div className="nav-account">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user