mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Make sure the selected/available rooms are updated when adding space children fails part way through. (#4997)
* Make sure the available rooms are updated if adding space children fails part way through. * Additionally handle the case where removing rooms fails part way through.
This commit is contained in:
@@ -39,6 +39,7 @@ struct SpaceScreenViewState: BindableState {
|
||||
|
||||
var editMode: EditMode = .inactive
|
||||
var editModeSelectedIDs: Set<String> = []
|
||||
var editModeRemovedIDs: Set<String> = []
|
||||
|
||||
var bindings = SpaceScreenViewStateBindings()
|
||||
|
||||
@@ -50,7 +51,7 @@ struct SpaceScreenViewState: BindableState {
|
||||
if editMode == .inactive {
|
||||
rooms
|
||||
} else {
|
||||
rooms.filter { !$0.isSpace }
|
||||
rooms.filter { !$0.isSpace && !editModeRemovedIDs.contains($0.id) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user