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:
Doug
2026-01-23 17:36:26 +00:00
committed by GitHub
parent a3683ea996
commit 3b231339cd
6 changed files with 125 additions and 12 deletions
@@ -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) }
}
}