always instantly load the overview (#14)

This commit is contained in:
Michael Quigley 2022-08-08 13:27:39 -04:00
parent 5a007f2401
commit d6cad21f18
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -13,13 +13,28 @@ const Network = () => {
useEffect(() => {
let mounted = true
let interval = setInterval(() => {
metadata.overview().then(resp => {
metadata.overview().then(resp => {
if(mounted) {
setOverview(resp.data)
let g = buildGraph(resp.data)
setNodes(getLayout(g))
setEdges(g.edges)
}
});
})
useEffect(() => {
let mounted = true
let interval = setInterval(() => {
metadata.overview().then(resp => {
if(mounted) {
setOverview(resp.data)
let g = buildGraph(resp.data)
setNodes(getLayout(g))
setEdges(g.edges)
}
})
}, 1000)
return () => {