mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-29 07:38:54 +00:00
ios: use trailing closure in MainActor.run calls
This commit is contained in:
@@ -312,7 +312,8 @@ struct ContextProfilePickerView: View {
|
||||
// and a notification action can have switched it while we were creating. After the
|
||||
// await above, not before it: checked first, that await reopens the very window
|
||||
// this closes. Kotlin orders it the same way.
|
||||
guard await MainActor.run({ chatModel.currentUser?.userId }) == ownerUserId else {
|
||||
let activeUserId = await MainActor.run { chatModel.currentUser?.userId }
|
||||
guard activeUserId == ownerUserId else {
|
||||
await MainActor.run { showAddProfile = false }
|
||||
alertAfterDismissal(NSLocalizedString("Error changing chat profile", comment: "alert title"))
|
||||
return
|
||||
|
||||
@@ -665,7 +665,8 @@ private struct ActiveProfilePicker: View {
|
||||
// selectedProfile handler runs, and a notification action can have switched it.
|
||||
// After the await above, not before it: checked first, that await reopens the very
|
||||
// window this closes. Kotlin orders it the same way.
|
||||
guard await MainActor.run({ chatModel.currentUser?.userId }) == ownerUserId else {
|
||||
let activeUserId = await MainActor.run { chatModel.currentUser?.userId }
|
||||
guard activeUserId == ownerUserId else {
|
||||
await MainActor.run { showAddProfile = false }
|
||||
alertAfterDismissal(NSLocalizedString("Error changing chat profile", comment: "alert title"))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user