mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-02 11:11:21 +01:00
Fixed data was not updating on page change
When switching from any page with a shared data fetch method between server and network, such as join address graph, the network page would not update the data, since the identifier is not in the parameter list. This was fixed by also checking parameters.length in useEffect dependencies.
This commit is contained in:
parent
c2000db8de
commit
c4058d3edb
@ -59,7 +59,7 @@ export const useDataRequest = (fetchMethod, parameters) => {
|
||||
fetchMethod(updateRequested, ...parameters).then(({data: json, error}) => {
|
||||
handleResponse(json, error, false, 1000);
|
||||
});
|
||||
}, [fetchMethod, ...parameters, updateRequested, refreshBarrierMs])
|
||||
}, [fetchMethod, parameters.length, ...parameters, updateRequested, refreshBarrierMs])
|
||||
/* eslint-enable react-hooks/exhaustive-deps */
|
||||
|
||||
return {data, loadingError};
|
||||
|
Loading…
Reference in New Issue
Block a user