From 287424d249b425933375bb0427a3a77c96d354fc Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 22 Jan 2025 18:22:03 +0100 Subject: [PATCH 1/2] UX: better feedback on osm connection state; add user agent and path --- src/Logic/Osm/OsmConnection.ts | 4 ++++ src/Logic/State/UserRelatedState.ts | 5 +++++ src/UI/ThemeViewGUI.svelte | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Logic/Osm/OsmConnection.ts b/src/Logic/Osm/OsmConnection.ts index 2caa69b6cb..fa28ded72d 100644 --- a/src/Logic/Osm/OsmConnection.ts +++ b/src/Logic/Osm/OsmConnection.ts @@ -607,6 +607,10 @@ export class OsmConnection { this.FetchCapabilities().then(({ api, gpx }) => { this.apiIsOnline.setData(api) this.gpxServiceIsOnline.setData(gpx) + }).catch(err => { + console.log("Could not reach the api:", err) + this.apiIsOnline.set("unreachable") + this.gpxServiceIsOnline.set("unreachable") }) } diff --git a/src/Logic/State/UserRelatedState.ts b/src/Logic/State/UserRelatedState.ts index 27f03e99e1..f58e66d4e1 100644 --- a/src/Logic/State/UserRelatedState.ts +++ b/src/Logic/State/UserRelatedState.ts @@ -416,6 +416,11 @@ export default class UserRelatedState { typeof window === "undefined" ? "no" : window.navigator.share ? "yes" : "no", _iframe: Utils.isIframe ? "yes" : "no", }) + if(!Utils.runningFromConsole){ + amendedPrefs.data["_host"] = window.location.host + amendedPrefs.data["_path"] = window.location.pathname + amendedPrefs.data["_userAgent"] = navigator.userAgent + } for (const key in Constants.userJourney) { amendedPrefs.data["__userjourney_" + key] = Constants.userJourney[key] diff --git a/src/UI/ThemeViewGUI.svelte b/src/UI/ThemeViewGUI.svelte index 1ffd31c500..bccb69ae17 100644 --- a/src/UI/ThemeViewGUI.svelte +++ b/src/UI/ThemeViewGUI.svelte @@ -421,7 +421,7 @@
Faking a user (Testmode)
- {#if $apiState !== "online"} + {#if $apiState !== "online" && $apiState !== "unknown"}
API is {$apiState}
{/if} From d9b910e36bd5140bf82328f5c9e028acec6840ae Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 22 Jan 2025 18:22:14 +0100 Subject: [PATCH 2/2] Scripts: hardcode types to download images for --- scripts/downloadNsiLogos.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/downloadNsiLogos.ts b/scripts/downloadNsiLogos.ts index f817b6f098..da1e22bb3d 100644 --- a/scripts/downloadNsiLogos.ts +++ b/scripts/downloadNsiLogos.ts @@ -190,7 +190,6 @@ class DownloadNsiLogos extends Script { } async main(): Promise { - const nsi = await NameSuggestionIndex.getNsiIndex() const types = ["brand", "operator"] for (const type of types) { await this.downloadFor(type)