Skip to content

Commit e722727

Browse files
committed
update bounds and simplify use effect
1 parent 21d78e3 commit e722727

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/components/TaskClusterMap/TaskClusterMap.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,16 @@ export const TaskClusterMap = (props) => {
174174

175175
if (isTaskInBundle) {
176176
map.setView(workspaceContext.taskMapBounds.getCenter(), workspaceContext.taskMapZoom);
177+
// Ensure markers are refetched after changing the map view
178+
if (props.updateBounds) {
179+
props.updateBounds(workspaceContext.taskMapBounds, workspaceContext.taskMapZoom, true);
180+
}
177181
setWorkspaceContext({
178182
taskPropertyClicked: false,
179183
});
180184
}
181185
}
182-
}, [
183-
workspaceContext?.taskMapBounds,
184-
workspaceContext?.taskMapZoom,
185-
workspaceContext?.taskMapTask?.id,
186-
workspaceContext?.taskPropertyClicked,
187-
]);
186+
}, [workspaceContext?.taskPropertyClicked]);
188187

189188
return null;
190189
};

0 commit comments

Comments
 (0)