From c94d9d838e4f48006039cb670415a2d95edab420 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 24 Feb 2022 02:51:10 +0100 Subject: [PATCH] Fix #677 --- UI/Popup/ImportButton.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/UI/Popup/ImportButton.ts b/UI/Popup/ImportButton.ts index 3f956c3f0..1f96829e3 100644 --- a/UI/Popup/ImportButton.ts +++ b/UI/Popup/ImportButton.ts @@ -41,6 +41,7 @@ import {AutoAction} from "./AutoApplyButton"; import LayoutConfig from "../../Models/ThemeConfig/LayoutConfig"; import {Changes} from "../../Logic/Osm/Changes"; import {ElementStorage} from "../../Logic/ElementStorage"; +import Hash from "../../Logic/Web/Hash"; /** * A helper class for the various import-flows. @@ -268,8 +269,8 @@ ${Utils.special_visualizations_importRequirementDocs} originalFeatureTags.data["_imported"] = "yes" originalFeatureTags.ping() // will set isImported as per its definition state.changes.applyAction(action) - state.selectedElement.setData(state.allElements.ContainingFeatures.get(action.newElementId ?? action.mainObjectId)) - + const newId = action.newElementId ?? action.mainObjectId + state.selectedElement.setData(state.allElements.ContainingFeatures.get(newId)) } }) @@ -572,6 +573,8 @@ export class ImportPointButton extends AbstractImportButton { state.selectedElement.setData(state.allElements.ContainingFeatures.get( newElementAction.newElementId )) + Hash.hash.setData(newElementAction.newElementId) + if (note_id !== undefined) { state.osmConnection.closeNote(note_id, "imported") originalFeatureTags.data["closed_at"] = new Date().toISOString()