fix: set id ref to none to fetch agent data on first change
This commit is contained in:
parent
5b9dc7cfc6
commit
951a96fad6
@ -8,8 +8,8 @@ export default function useAgent(nodeIds: string[], interval = 3000) {
|
||||
() => new URLSearchParams({ node_ids: nodeIds.join(',') }),
|
||||
[nodeIds],
|
||||
);
|
||||
const idRef = useRef<string[]>(nodeIds);
|
||||
|
||||
const idRef = useRef<string[]>([]);
|
||||
useEffect(() => {
|
||||
if (idRef.current.join(',') !== nodeIds.join(',')) {
|
||||
fetcher.load(`/api/agent?${qp.toString()}`);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user