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
|
||||
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,16 +160,15 @@ 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)
|
||||
userDefaults.removeObject(forKey: userDefaultsKeyNumberOfEdits)
|
||||
userDefaults.removeObject(forKey: userDefaultsNeedsReauthorization)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user