Business fixes

This commit is contained in:
Isaac
2024-03-01 18:32:29 +04:00
parent addc4dc436
commit 9ce2c2dc9e
10 changed files with 1127 additions and 8 deletions

View File

@@ -827,7 +827,21 @@ final class ChatbotSetupScreenComponent: Component {
selectionState: .none,
hasNext: false,
action: { peer, _, _ in
}
},
inlineActions: PeerListItemComponent.InlineActionsState(
actions: [PeerListItemComponent.InlineAction(
id: AnyHashable(0),
title: environment.strings.Common_Delete,
color: .destructive,
action: { [weak self] in
guard let self else {
return
}
self.additionalPeerList.categories.remove(category)
self.state?.updated(transition: .spring(duration: 0.4))
}
)]
)
))))
}
for peer in self.additionalPeerList.peers {
@@ -845,7 +859,21 @@ final class ChatbotSetupScreenComponent: Component {
selectionState: .none,
hasNext: false,
action: { peer, _, _ in
}
},
inlineActions: PeerListItemComponent.InlineActionsState(
actions: [PeerListItemComponent.InlineAction(
id: AnyHashable(0),
title: environment.strings.Common_Delete,
color: .destructive,
action: { [weak self] in
guard let self else {
return
}
self.additionalPeerList.peers.removeAll(where: { $0.peer.id == peer.peer.id })
self.state?.updated(transition: .spring(duration: 0.4))
}
)]
)
))))
}