Skip to content

Commit

Permalink
Update Rapid to v2.2.5
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed May 2, 2024
1 parent 1fde799 commit a4d5c37
Show file tree
Hide file tree
Showing 3 changed files with 380 additions and 341 deletions.
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"private": false,
"dependencies": {
"@hotosm/id": "^2.21.1",
"@hotosm/underpass-ui": "^0.0.4",
"@hotosm/iso-countries-languages": "^1.1.2",
"@hotosm/underpass-ui": "^0.0.4",
"@mapbox/mapbox-gl-draw": "^1.4.3",
"@mapbox/mapbox-gl-geocoder": "^5.0.2",
"@mapbox/mapbox-gl-language": "^0.10.1",
"@placemarkio/geo-viewport": "^1.0.2",
"@rapideditor/rapid": "^2.1.1",
"@rapideditor/rapid": "^2.2.5",
"@sentry/react": "^7.102.0",
"@tanstack/react-query": "^4.29.7",
"@tanstack/react-query-devtools": "^4.29.7",
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/rapidEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function RapidEditor({

useEffect(() => {
const containerRoot = document.getElementById('rapid-container-root');
const editListener = () => updateDisableState(setDisable, context.systems.edits);
const editListener = () => updateDisableState(setDisable, context.systems.editor);
if (context && dom) {
containerRoot.appendChild(dom);
// init the ui or restart if it was loaded previously
Expand All @@ -240,19 +240,19 @@ function RapidEditor({
/* Perform tasks after Rapid has started up */
promise.then(() => {
/* Keep track of edits */
const editSystem = context.systems.edits;
const editSystem = context.systems.editor;

editSystem.on('change', editListener);
editSystem.on('stablechange', editListener);
editSystem.on('reset', editListener);
});
}
return () => {
if (containerRoot?.childNodes && dom in containerRoot.childNodes) {
document.getElementById('rapid-container-root')?.removeChild(dom);
}
if (context?.systems?.edits) {
const editSystem = context.systems.edits;
editSystem.off('change', editListener);
if (context?.systems?.editor) {
const editSystem = context.systems.editor;
editSystem.off('stablechange', editListener);
editSystem.off('reset', editListener);
}
};
Expand Down
Loading

0 comments on commit a4d5c37

Please sign in to comment.