mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 21:16:35 +00:00
Fixed blocking app update flag
This commit is contained in:
parent
e906e0ee6a
commit
f5e2d58a84
@ -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)
|
||||||
|
|||||||
@ -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)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user