Fixed blocking app update flag

This commit is contained in:
Ilya Laktyushin 2019-07-11 02:38:41 +02:00
parent e906e0ee6a
commit f5e2d58a84
2 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ import Foundation
#endif #endif
public struct AppUpdateInfo: Equatable { public struct AppUpdateInfo: Equatable {
public let popup: Bool public let blocking: Bool
public let version: String public let version: String
public let text: String public let text: String
public let entities: [MessageTextEntity] public let entities: [MessageTextEntity]
@ -26,7 +26,7 @@ extension AppUpdateInfo {
init?(apiAppUpdate: Api.help.AppUpdate) { init?(apiAppUpdate: Api.help.AppUpdate) {
switch apiAppUpdate { switch apiAppUpdate {
case let .appUpdate(flags, _, version, text, entities, _, _): case let .appUpdate(flags, _, version, text, entities, _, _):
self.popup = (flags & (1 << 0)) != 0 self.blocking = (flags & (1 << 0)) != 0
self.version = version self.version = version
self.text = text self.text = text
self.entities = messageTextEntitiesFromApiEntities(entities) self.entities = messageTextEntitiesFromApiEntities(entities)

View File

@ -113,9 +113,9 @@ public func updateInfoController(context: AccountContext, appUpdateInfo: AppUpda
appIcon = appIcons.filter { $0.isDefault }.first appIcon = appIcons.filter { $0.isDefault }.first
} }
let leftNavigationButton = appUpdateInfo.popup ? ItemListNavigationButton(content: .text(presentationData.strings.Update_Skip), style: .regular, enabled: true, action: { let leftNavigationButton = appUpdateInfo.blocking ? nil : ItemListNavigationButton(content: .text(presentationData.strings.Update_Skip), style: .regular, enabled: true, action: {
dismissImpl?() dismissImpl?()
}) : nil })
let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Update_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Update_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back))
let listState = ItemListNodeState(entries: updateInfoControllerEntries(theme: presentationData.theme, strings: presentationData.strings, appIcon: appIcon, appUpdateInfo: appUpdateInfo), style: .blocks, animateChanges: false) let listState = ItemListNodeState(entries: updateInfoControllerEntries(theme: presentationData.theme, strings: presentationData.strings, appIcon: appIcon, appUpdateInfo: appUpdateInfo), style: .blocks, animateChanges: false)