mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-15 09:00:44 +00:00
core, ui: fix profiles, add error alerts (#7663)
* core, ui: fix profiles, add error alerts * simplify * query plans --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
co-authored by
Evgeny @ SimpleX Chat
parent
a24a3b1911
commit
9c9c86f9c0
@@ -1359,8 +1359,12 @@ func apiUpdateProfile(profile: Profile) async throws -> (Profile, [Contact])? {
|
||||
switch r {
|
||||
case .result(.userProfileNoChange): return (profile, [])
|
||||
case let .result(.userProfileUpdated(_, _, toProfile, updateSummary)): return (toProfile, updateSummary.changedContacts)
|
||||
case .error(.errorStore(.duplicateName)): return nil;
|
||||
default: throw r.unexpected
|
||||
case .error(.errorStore(.duplicateName)), .error(.error(.userExists)): return nil;
|
||||
default:
|
||||
await MainActor.run {
|
||||
showErrorAlert(r.unexpected, NSLocalizedString("Error saving profile", comment: "alert title"))
|
||||
}
|
||||
throw r.unexpected
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user