Skip to content

Commit

Permalink
Merge pull request #1591 from Vizzuality/MRXN23-512-inventory-panel-p…
Browse files Browse the repository at this point in the history
…rotected

[MRXN23-512]: hides floating menu after deletion process
  • Loading branch information
andresgnlez authored Nov 22, 2023
2 parents fbe8943 + 13c2728 commit 21c009d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/hooks/cost-surface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function useProjectCostSurfaces<T = CostSurface[]>(
const { data: session } = useSession();

return useQuery({
queryKey: ['cost-surfaces', pid],
queryKey: ['cost-surfaces', pid, params],
queryFn: async () =>
JSONAPI.request<{ data: CostSurface[] }>({
method: 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ const InventoryPanelCostSurface = ({ noData: noDataMessage }: { noData: string }
isVisibleOnMap: visibleCostSurface === cs.id,
}));

useEffect(() => {
if (allProjectCostSurfacesQuery.isRefetching) {
setSelectedCostSurfaceIds([]);
}
}, [allProjectCostSurfacesQuery.isRefetching]);

return (
<div className="flex flex-col space-y-6 overflow-hidden">
<div className="h-full overflow-hidden">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ const InventoryPanelProtectedAreas = ({
}
}, []);

useEffect(() => {
setSelectedWDPAIds([]);
}, [search]);

const toggleSeeOnMap = useCallback(
(WDPAId: WDPA['id']) => {
const newSelectedWDPAs = [...visibleWDPAs];
Expand Down Expand Up @@ -122,6 +118,12 @@ const InventoryPanelProtectedAreas = ({
isVisibleOnMap: layerSettings[wdpa.id]?.visibility ?? false,
}));

useEffect(() => {
if (allProjectWDPAsQuery.isRefetching) {
setSelectedWDPAIds([]);
}
}, [allProjectWDPAsQuery.isRefetching]);

return (
<div className="flex flex-col space-y-6 overflow-hidden">
<div className="h-full overflow-hidden">
Expand Down

1 comment on commit 21c009d

@vercel
Copy link

@vercel vercel bot commented on 21c009d Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marxan – ./

marxan23.vercel.app
marxan-vizzuality1.vercel.app
marxan-git-develop-vizzuality1.vercel.app

Please sign in to comment.