mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Fix ItemListController crash?
This commit is contained in:
@@ -359,7 +359,8 @@ private enum ChannelAdminEntry: ItemListNodeEntry {
|
||||
}
|
||||
}
|
||||
|
||||
func item(_ arguments: ChannelAdminControllerArguments) -> ListViewItem {
|
||||
func item(_ arguments: Any) -> ListViewItem {
|
||||
let arguments = arguments as! ChannelAdminControllerArguments
|
||||
switch self {
|
||||
case let .info(theme, strings, dateTimeFormat, peer, presence):
|
||||
return ItemListAvatarAndNameInfoItem(account: arguments.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: presence, cachedData: nil, state: ItemListAvatarAndNameInfoItemState(), sectionId: self.section, style: .blocks(withTopInset: true, withExtendedBottomInset: false), editingNameUpdated: { _ in
|
||||
@@ -861,7 +862,7 @@ public func channelAdminController(context: AccountContext, peerId: PeerId, admi
|
||||
|
||||
let signal = combineLatest(context.sharedContext.presentationData, statePromise.get(), combinedView)
|
||||
|> deliverOnMainQueue
|
||||
|> map { presentationData, state, combinedView -> (ItemListControllerState, (ItemListNodeState<ChannelAdminEntry>, ChannelAdminEntry.ItemGenerationArguments)) in
|
||||
|> map { presentationData, state, combinedView -> (ItemListControllerState, (ItemListNodeState, Any)) in
|
||||
let channelView = combinedView.views[.peer(peerId: peerId, components: .all)] as! PeerView
|
||||
let adminView = combinedView.views[.peer(peerId: adminId, components: .all)] as! PeerView
|
||||
let canEdit = canEditAdminRights(accountPeerId: context.account.peerId, channelView: channelView, initialParticipant: initialParticipant)
|
||||
|
||||
Reference in New Issue
Block a user