Skip to content

Commit a4d5c37

Browse files
committed
Update Rapid to v2.2.5
Signed-off-by: Taylor Smock <[email protected]>
1 parent 1fde799 commit a4d5c37

File tree

3 files changed

+380
-341
lines changed

3 files changed

+380
-341
lines changed

frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"private": false,
66
"dependencies": {
77
"@hotosm/id": "^2.21.1",
8-
"@hotosm/underpass-ui": "^0.0.4",
98
"@hotosm/iso-countries-languages": "^1.1.2",
9+
"@hotosm/underpass-ui": "^0.0.4",
1010
"@mapbox/mapbox-gl-draw": "^1.4.3",
1111
"@mapbox/mapbox-gl-geocoder": "^5.0.2",
1212
"@mapbox/mapbox-gl-language": "^0.10.1",
1313
"@placemarkio/geo-viewport": "^1.0.2",
14-
"@rapideditor/rapid": "^2.1.1",
14+
"@rapideditor/rapid": "^2.2.5",
1515
"@sentry/react": "^7.102.0",
1616
"@tanstack/react-query": "^4.29.7",
1717
"@tanstack/react-query-devtools": "^4.29.7",

frontend/src/components/rapidEditor.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function RapidEditor({
223223

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

245-
editSystem.on('change', editListener);
245+
editSystem.on('stablechange', editListener);
246246
editSystem.on('reset', editListener);
247247
});
248248
}
249249
return () => {
250250
if (containerRoot?.childNodes && dom in containerRoot.childNodes) {
251251
document.getElementById('rapid-container-root')?.removeChild(dom);
252252
}
253-
if (context?.systems?.edits) {
254-
const editSystem = context.systems.edits;
255-
editSystem.off('change', editListener);
253+
if (context?.systems?.editor) {
254+
const editSystem = context.systems.editor;
255+
editSystem.off('stablechange', editListener);
256256
editSystem.off('reset', editListener);
257257
}
258258
};

0 commit comments

Comments
 (0)