From 6ccc9d63d0bf51c1d139219437535d32c515b751 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 13 Dec 2024 14:54:06 +0100 Subject: [PATCH] UX: don't prompt to login when trying to load an initial note --- src/Logic/Actors/InitialMapPositioning.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Logic/Actors/InitialMapPositioning.ts b/src/Logic/Actors/InitialMapPositioning.ts index 7e4ce6d88..04348a544 100644 --- a/src/Logic/Actors/InitialMapPositioning.ts +++ b/src/Logic/Actors/InitialMapPositioning.ts @@ -93,12 +93,14 @@ export default class InitialMapPositioning { } else if (layoutToUse.id === "notes" && initialHash?.match(/[0-9]+/)) { console.log("Loading note", initialHash) const noteId = Number(initialHash) - osmConnection.getNote(noteId).then(note => { - const [lon, lat] = note.geometry.coordinates - console.log("Got note:", note) - this.location.set({ lon, lat }) - } - ) + if (osmConnection.isLoggedIn.data) { + osmConnection.getNote(noteId).then(note => { + const [lon, lat] = note.geometry.coordinates + console.log("Got note:", note) + this.location.set({ lon, lat }) + } + ) + } } else if ( Constants.GeoIpServer && lat.data === defaultLat &&