mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Fix crashes when blocking/unblocking users
- SwiftUI crashes when mutating optional state properties in place - workaround it buy mutating a local reference first
This commit is contained in:
parent
b0f109a023
commit
9ce12e6e16
@ -108,7 +108,10 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro
|
||||
state.isProcessingIgnoreRequest = false
|
||||
switch result {
|
||||
case .success:
|
||||
state.memberDetails?.isIgnored = true
|
||||
var details = state.memberDetails
|
||||
details?.isIgnored = true
|
||||
state.memberDetails = details
|
||||
|
||||
updateMembers()
|
||||
case .failure:
|
||||
state.bindings.alertInfo = .init(id: .unknown)
|
||||
@ -126,7 +129,10 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro
|
||||
state.isProcessingIgnoreRequest = false
|
||||
switch result {
|
||||
case .success:
|
||||
state.memberDetails?.isIgnored = false
|
||||
var details = state.memberDetails
|
||||
details?.isIgnored = false
|
||||
state.memberDetails = details
|
||||
|
||||
updateMembers()
|
||||
case .failure:
|
||||
state.bindings.alertInfo = .init(id: .unknown)
|
||||
|
1
changelog.d/pr-2553.bugfix
Normal file
1
changelog.d/pr-2553.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix crashes when blocking/unblocking users
|
Loading…
x
Reference in New Issue
Block a user