Various fixes

This commit is contained in:
Ilya Laktyushin
2022-04-23 20:03:10 +04:00
parent 5229c1666c
commit 14627e2986
9 changed files with 76 additions and 12 deletions

View File

@@ -778,16 +778,20 @@ final class ChatListContainerNode: ASDisplayNode, UIGestureRecognizerDelegate {
}
}
func updateState(_ f: (ChatListNodeState) -> ChatListNodeState) {
func updateState(onlyCurrent: Bool = true, _ f: (ChatListNodeState) -> ChatListNodeState) {
self.currentItemNode.updateState(f)
let updatedState = self.currentItemNode.currentState
for (id, itemNode) in self.itemNodes {
if id != self.selectedId {
itemNode.listNode.updateState { state in
var state = state
state.editing = updatedState.editing
state.selectedPeerIds = updatedState.selectedPeerIds
return state
if onlyCurrent {
itemNode.listNode.updateState { state in
var state = state
state.editing = updatedState.editing
state.selectedPeerIds = updatedState.selectedPeerIds
return state
}
} else {
itemNode.listNode.updateState(f)
}
}
}