fix: change fetchAndUpdateNetworks to be a cached callback
This commit is contained in:
parent
ccce11d34d
commit
f68070e38c
|
@ -57,7 +57,7 @@ const LumeProvider = ({ children }) => {
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const fetchAndUpdateNetworks = async () => {
|
const fetchAndUpdateNetworks = useCallback(async () => {
|
||||||
const unsub = () => {
|
const unsub = () => {
|
||||||
statusUnsubs.current.forEach((unsub) => unsub());
|
statusUnsubs.current.forEach((unsub) => unsub());
|
||||||
statusUnsubs.current = new Map<any, any>();
|
statusUnsubs.current = new Map<any, any>();
|
||||||
|
@ -118,7 +118,7 @@ const LumeProvider = ({ children }) => {
|
||||||
console.error("Error fetching and updating networks:", error);
|
console.error("Error fetching and updating networks:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}, [handleStatusUpdate]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchAndUpdateNetworks();
|
fetchAndUpdateNetworks();
|
||||||
|
|
Loading…
Reference in New Issue