mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
perf: fetch watchlists on modal open only
This commit is contained in:
@@ -28,8 +28,10 @@ export default function WatchlistSelectionModal(props: WatchlistSelectionModalPr
|
||||
const [validationLoading, setValidationLoading] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
getWatchlists().then(list => setWatchlists(list["hydra:member"]))
|
||||
}, [])
|
||||
if (props.open && !watchlists) {
|
||||
getWatchlists().then(list => setWatchlists(list["hydra:member"]))
|
||||
}
|
||||
}, [props.open])
|
||||
|
||||
const onFinish = () => {
|
||||
const promise = props.onFinish(selectedWatchlist as Watchlist)
|
||||
|
||||
Reference in New Issue
Block a user