forked from MapComplete/MapComplete
UX: better feedback on osm connection state; add user agent and path
This commit is contained in:
parent
09109925bc
commit
287424d249
3 changed files with 10 additions and 1 deletions
|
@ -607,6 +607,10 @@ export class OsmConnection {
|
||||||
this.FetchCapabilities().then(({ api, gpx }) => {
|
this.FetchCapabilities().then(({ api, gpx }) => {
|
||||||
this.apiIsOnline.setData(api)
|
this.apiIsOnline.setData(api)
|
||||||
this.gpxServiceIsOnline.setData(gpx)
|
this.gpxServiceIsOnline.setData(gpx)
|
||||||
|
}).catch(err => {
|
||||||
|
console.log("Could not reach the api:", err)
|
||||||
|
this.apiIsOnline.set("unreachable")
|
||||||
|
this.gpxServiceIsOnline.set("unreachable")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -416,6 +416,11 @@ export default class UserRelatedState {
|
||||||
typeof window === "undefined" ? "no" : window.navigator.share ? "yes" : "no",
|
typeof window === "undefined" ? "no" : window.navigator.share ? "yes" : "no",
|
||||||
_iframe: Utils.isIframe ? "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) {
|
for (const key in Constants.userJourney) {
|
||||||
amendedPrefs.data["__userjourney_" + key] = Constants.userJourney[key]
|
amendedPrefs.data["__userjourney_" + key] = Constants.userJourney[key]
|
||||||
|
|
|
@ -421,7 +421,7 @@
|
||||||
<If condition={state.featureSwitches.featureSwitchFakeUser}>
|
<If condition={state.featureSwitches.featureSwitchFakeUser}>
|
||||||
<div class="alert w-fit">Faking a user (Testmode)</div>
|
<div class="alert w-fit">Faking a user (Testmode)</div>
|
||||||
</If>
|
</If>
|
||||||
{#if $apiState !== "online"}
|
{#if $apiState !== "online" && $apiState !== "unknown"}
|
||||||
<div class="alert w-fit">API is {$apiState}</div>
|
<div class="alert w-fit">API is {$apiState}</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue