[ios] Fixing reappearing login promts

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-07-08 13:36:54 +02:00
parent 9e49aae49e
commit 87dad591ab

View File

@@ -138,6 +138,7 @@ import OSMEditor
/// Reload the OpenStreetMap profile
static func reload() async {
if isExisting {
// Could be done in nicer way, but that would require iOS 17+
await withCheckedContinuation { continuation in
let networkPathMonitor: NWPathMonitor = NWPathMonitor()
@@ -159,11 +160,11 @@ import OSMEditor
networkPathMonitor.start(queue: .main)
}
}
}
/// Logout of the OpenStreetMap profile
static func logout() {
if isExisting {
let userDefaults = UserDefaults.standard
userDefaults.removeObject(forKey: userDefaultsKeyAuthorizationToken)
userDefaults.removeObject(forKey: userDefaultsKeyName)
@@ -171,4 +172,3 @@ import OSMEditor
userDefaults.removeObject(forKey: userDefaultsNeedsReauthorization)
}
}
}