Skip to content

Commit

Permalink
Merge pull request #434 from hotosm/feat/implement-gcp
Browse files Browse the repository at this point in the history
Feat/update gcp-editor version
  • Loading branch information
suzit-10 authored Jan 9, 2025
2 parents 034121c + d2453b8 commit 7b33efb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": {
"@cyntler/react-doc-viewer": "^1.17.0",
"@geomatico/maplibre-cog-protocol": "^0.3.1",
"@hotosm/gcp-editor": "^0.0.6",
"@hotosm/gcp-editor": "^0.0.8",
"@mapbox/mapbox-gl-draw": "^1.4.2",
"@mapbox/mapbox-gl-draw-static-mode": "^1.0.1",
"@radix-ui/react-popover": "^1.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ const GcpEditor = ({
};

useEffect(() => {
document.addEventListener(CUSTOM_EVENT, data => {
startProcessing(data);
});
return document.removeEventListener(CUSTOM_EVENT, data => {
startProcessing(data);
});
document.addEventListener(
CUSTOM_EVENT,
data => {
startProcessing(data);
},
// When we use the {once: true} option when adding an event listener, the listener will be invoked at most once and immediately removed as soon as the event is invoked.
{ once: true },
);

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [CUSTOM_EVENT, dispatch]);

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/views/IndividualProject/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ const IndividualProject = () => {
close
</button>
<GcpEditor
finalButtonText="Final Processing"
finalButtonText="Start Final Processing"
// handleProcessingStart={handleStartProcessingClick}
// eslint-disable-next-line camelcase
rawImageUrl={`${BASE_URL}/gcp/find-project-images/?project_id=${id}`}
// rawImageUrl={`${BASE_URL}/gcp/find-project-images/?project_id=${id}`}
/>
</div>
) : (
Expand Down

0 comments on commit 7b33efb

Please sign in to comment.