UX: better feedback on osm connection state; add user agent and path

This commit is contained in:
Pieter Vander Vennet 2025-01-22 18:22:03 +01:00
parent 09109925bc
commit 287424d249
3 changed files with 10 additions and 1 deletions

View file

@ -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")
})
}

View file

@ -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]

View file

@ -421,7 +421,7 @@
<If condition={state.featureSwitches.featureSwitchFakeUser}>
<div class="alert w-fit">Faking a user (Testmode)</div>
</If>
{#if $apiState !== "online"}
{#if $apiState !== "online" && $apiState !== "unknown"}
<div class="alert w-fit">API is {$apiState}</div>
{/if}
</div>