Skip to content

Commit

Permalink
fix workspace context
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Jun 24, 2024
1 parent 18070b3 commit 72f9ce7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/TaskPane/TaskMap/TaskMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,21 @@ export const TaskMapContainer = (props) => {


useEffect(() => {
setLatestBounds(map.getBounds())
setLatestZoom(map.getZoom())
const currentBounds = map.getBounds()
const currentZoom = map.getZoom()

if (props.task.id !== props.completingTask) {
props.setTaskMapBounds(props.task.id, latestBounds, latestZoom, false)
props.setTaskMapBounds(props.task.id, currentBounds, currentZoom, false)
if (props.setWorkspaceContext) {
props.setWorkspaceContext({
taskMapTask: props.task,
taskMapBounds: latestBounds,
taskMapZoom: latestZoom
taskMapBounds: currentBounds,
taskMapZoom: currentZoom
})
}
}
setLatestBounds(currentBounds)
setLatestZoom(currentZoom)
}, [map])

const mapillaryImageMarkers = () => {
Expand Down

0 comments on commit 72f9ce7

Please sign in to comment.