UX: make settings available if not logged in

This commit is contained in:
Pieter Vander Vennet 2025-01-21 20:47:57 +01:00
parent 3bf099c14a
commit 87c68cedc7
4 changed files with 30 additions and 24 deletions

View file

@ -146,7 +146,7 @@ export class OsmConnection {
this.UpdateCapabilities()
this.isLoggedIn = this.userDetails.map(
(user) => user !== undefined && (this.apiIsOnline.data === "unknown" || this.apiIsOnline.data === "online"),
(user) => user !== undefined && this.apiIsOnline.data === "online",
[this.apiIsOnline]
)
@ -578,8 +578,10 @@ export class OsmConnection {
if (!(this.apiIsOnline.data === "unreachable" || this.apiIsOnline.data === "offline")) {
return
}
if (!this.isLoggedIn.data) {
return
}
try {
console.log("Api is offline - trying to reconnect...")
this.AttemptLogin()
} catch (e) {
console.log("Could not login due to", e)