mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Various fixes
This commit is contained in:
parent
bdc1d7de3e
commit
9efb377288
@ -567,6 +567,15 @@ class GiftOptionItemNode: ItemListRevealOptionsItemNode {
|
||||
transition.updateFrame(node: strongSelf.labelNode, frame: labelFrame)
|
||||
} else {
|
||||
transition.updateFrame(node: strongSelf.labelNode, frame: CGRect(origin: CGPoint(x: layoutSize.width - rightInset - labelLayout.size.width - 18.0, y: floorToScreenPixels((layout.contentSize.height - labelLayout.size.height) / 2.0)), size: labelLayout.size))
|
||||
|
||||
if let labelIconNode = strongSelf.labelIconNode {
|
||||
strongSelf.labelIconNode = nil
|
||||
labelIconNode.removeFromSupernode()
|
||||
}
|
||||
if let labelBackgroundNode = strongSelf.labelBackgroundNode {
|
||||
strongSelf.labelBackgroundNode = nil
|
||||
labelBackgroundNode.removeFromSupernode()
|
||||
}
|
||||
}
|
||||
|
||||
if item.subtitleActive {
|
||||
|
@ -122,10 +122,10 @@ func _internal_getPremiumGiveawayInfo(account: Account, peerId: EnginePeer.Id, m
|
||||
}
|
||||
case let .giveawayInfoResults(flags, startDate, giftCodeSlug, finishDate, winnersCount, activatedCount):
|
||||
let status: PremiumGiveawayInfo.ResultStatus
|
||||
if let giftCodeSlug = giftCodeSlug {
|
||||
status = .won(slug: giftCodeSlug)
|
||||
} else if (flags & (1 << 1)) != 0 {
|
||||
if (flags & (1 << 1)) != 0 {
|
||||
status = .refunded
|
||||
} else if let giftCodeSlug = giftCodeSlug {
|
||||
status = .won(slug: giftCodeSlug)
|
||||
} else {
|
||||
status = .notWon
|
||||
}
|
||||
|
@ -1248,6 +1248,10 @@ public extension TelegramEngine {
|
||||
public func toggleRecommendedChannelsHidden(peerId: EnginePeer.Id, hidden: Bool) -> Signal<Never, NoError> {
|
||||
return _internal_toggleRecommendedChannelsHidden(account: self.account, peerId: peerId, hidden: hidden)
|
||||
}
|
||||
|
||||
public func requestRecommendedChannels(peerId: EnginePeer.Id) -> Signal<Never, NoError> {
|
||||
return _internal_requestRecommendedChannels(account: self.account, peerId: peerId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,10 +129,14 @@ public class ChatMessageJoinedChannelBubbleContentNode: ChatMessageBubbleContent
|
||||
}
|
||||
|
||||
@objc private func pressed() {
|
||||
guard let item = self.item, let recommendedChannels = item.associatedData.recommendedChannels else {
|
||||
guard let item = self.item else {
|
||||
return
|
||||
}
|
||||
let _ = item.context.engine.peers.toggleRecommendedChannelsHidden(peerId: item.message.id.peerId, hidden: !recommendedChannels.isHidden).startStandalone()
|
||||
if let recommendedChannels = item.associatedData.recommendedChannels {
|
||||
let _ = item.context.engine.peers.toggleRecommendedChannelsHidden(peerId: item.message.id.peerId, hidden: !recommendedChannels.isHidden).startStandalone()
|
||||
} else {
|
||||
let _ = item.context.engine.peers.requestRecommendedChannels(peerId: item.message.id.peerId).startStandalone()
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func closeButtonPressed() {
|
||||
@ -190,7 +194,7 @@ public class ChatMessageJoinedChannelBubbleContentNode: ChatMessageBubbleContent
|
||||
}
|
||||
|
||||
let isExpanded: Bool
|
||||
if let recommendedChannels = item.associatedData.recommendedChannels, !recommendedChannels.isHidden {
|
||||
if let recommendedChannels = item.associatedData.recommendedChannels, !recommendedChannels.channels.isEmpty && !recommendedChannels.isHidden {
|
||||
isExpanded = true
|
||||
} else {
|
||||
isExpanded = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user