mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
[WIP] Modern cache
This commit is contained in:
@@ -14,13 +14,15 @@ class BotCheckoutHeaderItem: ListViewItem, ItemListItem {
|
||||
let account: Account
|
||||
let theme: PresentationTheme
|
||||
let invoice: TelegramMediaInvoice
|
||||
let source: BotPaymentInvoiceSource
|
||||
let botName: String
|
||||
let sectionId: ItemListSectionId
|
||||
|
||||
init(account: Account, theme: PresentationTheme, invoice: TelegramMediaInvoice, botName: String, sectionId: ItemListSectionId) {
|
||||
init(account: Account, theme: PresentationTheme, invoice: TelegramMediaInvoice, source: BotPaymentInvoiceSource, botName: String, sectionId: ItemListSectionId) {
|
||||
self.account = account
|
||||
self.theme = theme
|
||||
self.invoice = invoice
|
||||
self.source = source
|
||||
self.botName = botName
|
||||
self.sectionId = sectionId
|
||||
}
|
||||
@@ -173,7 +175,15 @@ class BotCheckoutHeaderItemNode: ListViewItemNode {
|
||||
maxTextWidth = max(1.0, maxTextWidth - imageSize.width - imageTextSpacing)
|
||||
if imageUpdated {
|
||||
updatedImageSignal = chatWebFileImage(account: item.account, file: photo)
|
||||
updatedFetchSignal = fetchedMediaResource(mediaBox: item.account.postbox.mediaBox, reference: .standalone(resource: photo.resource))
|
||||
|
||||
var userLocation: MediaResourceUserLocation = .other
|
||||
switch item.source {
|
||||
case let .message(messageId):
|
||||
userLocation = .peer(messageId.peerId)
|
||||
default:
|
||||
break
|
||||
}
|
||||
updatedFetchSignal = fetchedMediaResource(mediaBox: item.account.postbox.mediaBox, userLocation: userLocation, userContentType: .image, reference: .standalone(resource: photo.resource))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user