mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Fix a crash when blocking/unblocking a user (#2143)
The view state doesn't like mutating an optional when built in release mode.
This commit is contained in:
parent
7b8f4f8276
commit
99f5601330
@ -254,7 +254,10 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
|||||||
state.isProcessingIgnoreRequest = false
|
state.isProcessingIgnoreRequest = false
|
||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
state.dmRecipient?.isIgnored = true
|
// Mutating the optional in place when built for Release crashes 🤷♂️
|
||||||
|
var dmRecipient = state.dmRecipient
|
||||||
|
dmRecipient?.isIgnored = true
|
||||||
|
state.dmRecipient = dmRecipient
|
||||||
case .failure, .none:
|
case .failure, .none:
|
||||||
state.bindings.alertInfo = .init(id: .unknown)
|
state.bindings.alertInfo = .init(id: .unknown)
|
||||||
}
|
}
|
||||||
@ -266,7 +269,10 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
|||||||
state.isProcessingIgnoreRequest = false
|
state.isProcessingIgnoreRequest = false
|
||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
state.dmRecipient?.isIgnored = false
|
// Mutating the optional in place when built for Release crashes 🤷♂️
|
||||||
|
var dmRecipient = state.dmRecipient
|
||||||
|
dmRecipient?.isIgnored = false
|
||||||
|
state.dmRecipient = dmRecipient
|
||||||
case .failure, .none:
|
case .failure, .none:
|
||||||
state.bindings.alertInfo = .init(id: .unknown)
|
state.bindings.alertInfo = .init(id: .unknown)
|
||||||
}
|
}
|
||||||
|
1
changelog.d/2140.bugfix
Normal file
1
changelog.d/2140.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix a crash when blocking/unblocking a user from the DM details screen.
|
Loading…
x
Reference in New Issue
Block a user