Skip to content

Commit

Permalink
Saved Requests: update items when network changes
Browse files Browse the repository at this point in the history
  • Loading branch information
quietbits committed Nov 21, 2024
1 parent a3d1a3c commit 88b9fc0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/app/(sidebar)/endpoints/components/SavedEndpointsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,16 @@ export const SavedEndpointsPage = () => {
>();

useEffect(() => {
setSavedEndpointsHorizon(localStorageSavedEndpointsHorizon.get());
setSavedRpcMethods(localStorageSavedRpcMethods.get());
}, []);
const horizonItems = localStorageSavedEndpointsHorizon
.get()
.filter((h) => h.network.id === network.id);
const rpcItems = localStorageSavedRpcMethods
.get()
.filter((r) => r.network.id === network.id);

setSavedEndpointsHorizon(horizonItems);
setSavedRpcMethods(rpcItems);
}, [network.id]);

useEffect(() => {
const mappedRpcIndex = savedRpcMethods.reduce(
Expand Down

0 comments on commit 88b9fc0

Please sign in to comment.