mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-07 14:53:35 +00:00
Various fixes
This commit is contained in:
parent
1b723cd2a7
commit
19d984dc8f
@ -2094,11 +2094,7 @@ private final class PremiumIntroScreenComponent: CombinedComponent {
|
|||||||
strongSelf.otherPeerName = otherPeerName
|
strongSelf.otherPeerName = otherPeerName
|
||||||
|
|
||||||
if !hadProducts {
|
if !hadProducts {
|
||||||
if let _ = products.first(where: { $0.isCurrent }) {
|
strongSelf.selectedProductId = strongSelf.products?.first?.id
|
||||||
strongSelf.selectedProductId = strongSelf.products?.first?.id
|
|
||||||
} else {
|
|
||||||
strongSelf.selectedProductId = strongSelf.products?.last?.id
|
|
||||||
}
|
|
||||||
|
|
||||||
for (_, video) in promoConfiguration.videos {
|
for (_, video) in promoConfiguration.videos {
|
||||||
strongSelf.preloadDisposableSet.add(preloadVideoResource(postbox: context.account.postbox, userLocation: .other, userContentType: .video, resourceReference: .standalone(resource: video.resource), duration: 3.0).start())
|
strongSelf.preloadDisposableSet.add(preloadVideoResource(postbox: context.account.postbox, userLocation: .other, userContentType: .video, resourceReference: .standalone(resource: video.resource), duration: 3.0).start())
|
||||||
|
|||||||
@ -1397,14 +1397,29 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||||||
scrollAnimationCurve = .Spring(duration: 0.4)
|
scrollAnimationCurve = .Spring(duration: 0.4)
|
||||||
} else {
|
} else {
|
||||||
let wasPlaying = strongSelf.appliedPlayingMessageId != nil
|
let wasPlaying = strongSelf.appliedPlayingMessageId != nil
|
||||||
|
|
||||||
if strongSelf.appliedPlayingMessageId != currentlyPlayingMessageId, let (currentlyPlayingMessageId, currentlyPlayingVideo) = currentlyPlayingMessageIdAndType {
|
if strongSelf.appliedPlayingMessageId != currentlyPlayingMessageId, let (currentlyPlayingMessageId, currentlyPlayingVideo) = currentlyPlayingMessageIdAndType {
|
||||||
if isFirstTime {
|
if isFirstTime {
|
||||||
} else if case let .peer(peerId) = chatLocation, currentlyPlayingMessageId.id.peerId != peerId {
|
} else if case let .peer(peerId) = chatLocation, currentlyPlayingMessageId.id.peerId != peerId {
|
||||||
} else {
|
} else {
|
||||||
if wasPlaying || currentlyPlayingVideo {
|
var isChat = false
|
||||||
updatedScrollPosition = .index(index: .message(currentlyPlayingMessageId), position: .center(.bottom), directionHint: .Up, animated: true, highlight: true, displayLink: true)
|
if case .peer = chatLocation {
|
||||||
scrollAnimationCurve = .Spring(duration: 0.4)
|
isChat = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isChat && (wasPlaying || currentlyPlayingVideo)) || (!isChat && !wasPlaying && currentlyPlayingVideo) {
|
||||||
|
var currentIsVisible = true
|
||||||
|
if let appliedPlayingMessageId = strongSelf.appliedPlayingMessageId {
|
||||||
|
currentIsVisible = false
|
||||||
|
strongSelf.forEachVisibleMessageItemNode({ view in
|
||||||
|
if view.item?.message.id == appliedPlayingMessageId.id {
|
||||||
|
currentIsVisible = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if currentIsVisible {
|
||||||
|
updatedScrollPosition = .index(index: .message(currentlyPlayingMessageId), position: .center(.bottom), directionHint: .Up, animated: true, highlight: true, displayLink: true)
|
||||||
|
scrollAnimationCurve = .Spring(duration: 0.4)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user