mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[ios] Fixing reappearing login promts
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -138,6 +138,7 @@ import OSMEditor
|
|||||||
|
|
||||||
/// Reload the OpenStreetMap profile
|
/// Reload the OpenStreetMap profile
|
||||||
static func reload() async {
|
static func reload() async {
|
||||||
|
if isExisting {
|
||||||
// Could be done in nicer way, but that would require iOS 17+
|
// Could be done in nicer way, but that would require iOS 17+
|
||||||
await withCheckedContinuation { continuation in
|
await withCheckedContinuation { continuation in
|
||||||
let networkPathMonitor: NWPathMonitor = NWPathMonitor()
|
let networkPathMonitor: NWPathMonitor = NWPathMonitor()
|
||||||
@@ -159,11 +160,11 @@ import OSMEditor
|
|||||||
networkPathMonitor.start(queue: .main)
|
networkPathMonitor.start(queue: .main)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Logout of the OpenStreetMap profile
|
/// Logout of the OpenStreetMap profile
|
||||||
static func logout() {
|
static func logout() {
|
||||||
if isExisting {
|
|
||||||
let userDefaults = UserDefaults.standard
|
let userDefaults = UserDefaults.standard
|
||||||
userDefaults.removeObject(forKey: userDefaultsKeyAuthorizationToken)
|
userDefaults.removeObject(forKey: userDefaultsKeyAuthorizationToken)
|
||||||
userDefaults.removeObject(forKey: userDefaultsKeyName)
|
userDefaults.removeObject(forKey: userDefaultsKeyName)
|
||||||
@@ -171,4 +172,3 @@ import OSMEditor
|
|||||||
userDefaults.removeObject(forKey: userDefaultsNeedsReauthorization)
|
userDefaults.removeObject(forKey: userDefaultsNeedsReauthorization)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user