Skip to content

Commit 3f5668d

Browse files
Merge pull request #7279 from hotosm/fix/id-editor-version-bump
Upgrade @openstreetmap/id 2.38.0 to 2.41.2
2 parents bc5e93e + 8c79238 commit 3f5668d

4 files changed

Lines changed: 64 additions & 447 deletions

File tree

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"@hotosm/iso-countries-languages": "^1.1.2",
88
"@maplibre/maplibre-gl-geocoder": "^1.9.0",
9-
"@openstreetmap/id": "2.38.0",
9+
"@openstreetmap/id": "2.41.2",
1010
"@osm-sandbox/sandbox-id": "https://github.com/osm-sandbox/sandbox-iD.git#9e51118ca32676c17ed5fc5d20faccc078ebc2eb",
1111
"@placemarkio/geo-viewport": "^1.0.2",
1212
"@rapideditor/rapid": "^2.5.2",

frontend/src/components/editor.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ export default function Editor({ setDisable, comment, presets, imagery, gpxUrl,
7171
}
7272
}, [windowInit, iDContext, dispatch]);
7373

74+
// Reset context on unmount so the sandbox editor always gets a fresh context
75+
// from its own window.iD (sandbox-id), preventing cross-editor context bleed.
76+
useEffect(() => {
77+
return () => {
78+
dispatch({ type: 'SET_EDITOR', context: null });
79+
};
80+
}, [dispatch]);
81+
7482
useEffect(() => {
7583
if (iDContext && comment) {
7684
iDContext.defaultChangesetComment(comment);

frontend/src/components/sandboxEditor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ export default function SandboxEditor({
265265

266266
useEffect(() => {
267267
return () => {
268+
// Reset auth status for this sandbox on unmount
268269
dispatch(setSandboxAuthStatus(sandboxId, 'idle'));
270+
// Reset context on unmount so the OSM iD editor always gets a fresh context
271+
// from its own window.iD (@openstreetmap/id), preventing cross-editor context bleed.
272+
dispatch({ type: 'SET_EDITOR', context: null });
269273
};
270274
}, [dispatch, sandboxId]);
271275

0 commit comments

Comments
 (0)