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