mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Filter valid file size
This commit is contained in:
@@ -628,7 +628,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
|
||||
let descriptionText: String
|
||||
if let performer = performer {
|
||||
descriptionText = performer
|
||||
} else if let size = arguments.file.size {
|
||||
} else if let size = arguments.file.size, size > 0 && size != .max {
|
||||
descriptionText = dataSizeString(size, formatting: DataSizeStringFormatting(chatPresentationData: arguments.presentationData))
|
||||
} else {
|
||||
descriptionText = ""
|
||||
@@ -656,7 +656,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
|
||||
descriptionString = candidateDescriptionString
|
||||
} else if !isVoice {
|
||||
let descriptionText: String
|
||||
if let size = arguments.file.size {
|
||||
if let size = arguments.file.size, size > 0 && size != .max {
|
||||
descriptionText = dataSizeString(size, formatting: DataSizeStringFormatting(chatPresentationData: arguments.presentationData))
|
||||
} else {
|
||||
descriptionText = ""
|
||||
@@ -1468,7 +1468,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
|
||||
if let fetchStatus = fetchStatus {
|
||||
switch fetchStatus {
|
||||
case let .Fetching(_, progress):
|
||||
if let size = file.size {
|
||||
if let size = file.size, size > 0 && size != .max {
|
||||
let compactString = dataSizeString(Int(Float(size) * progress), forceDecimal: true, formatting: DataSizeStringFormatting(chatPresentationData: presentationData))
|
||||
let descriptionFont = Font.with(size: floor(presentationData.fontSize.baseDisplaySize * 13.0 / 17.0), design: .regular, weight: .regular, traits: [.monospacedNumbers])
|
||||
downloadingStrings = ("\(compactString) / \(dataSizeString(size, forceDecimal: true, formatting: DataSizeStringFormatting(chatPresentationData: presentationData)))", compactString, descriptionFont)
|
||||
|
||||
Reference in New Issue
Block a user