Fix ItemListController crash?

This commit is contained in:
Peter
2019-10-06 04:25:10 +04:00
parent 3ddbeea591
commit 36c82642d6
77 changed files with 615 additions and 244 deletions

View File

@@ -66,7 +66,8 @@ private enum UpdateInfoControllerEntry: ItemListNodeEntry {
return lhs.stableId < rhs.stableId
}
func item(_ arguments: UpdateInfoControllerArguments) -> ListViewItem {
func item(_ arguments: Any) -> ListViewItem {
let arguments = arguments as! UpdateInfoControllerArguments
switch self {
case let .info(theme, icon, title, text, entities):
return UpdateInfoItem(theme: theme, appIcon: icon, title: title, text: text, entities: entities, sectionId: self.section, style: .blocks, linkItemAction: { action, itemLink in
@@ -106,7 +107,7 @@ public func updateInfoController(context: AccountContext, appUpdateInfo: AppUpda
let signal = context.sharedContext.presentationData
|> deliverOnMainQueue
|> map { presentationData -> (ItemListControllerState, (ItemListNodeState<UpdateInfoControllerEntry>, UpdateInfoControllerEntry.ItemGenerationArguments)) in
|> map { presentationData -> (ItemListControllerState, (ItemListNodeState, Any)) in
let appIcon: PresentationAppIcon?
let appIcons = context.sharedContext.applicationBindings.getAvailableAlternateIcons()
if let alternateIconName = context.sharedContext.applicationBindings.getAlternateIconName() {