mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix a number of tag loading glitches
This commit is contained in:
parent
e1e1abf4b1
commit
4ffc6367bb
@ -950,7 +950,15 @@ func fetchMessageHistoryHole(accountPeerId: PeerId, source: FetchMessageHistoryH
|
||||
case let .aroundId(aroundId):
|
||||
filledRange = min(aroundId.id, messageRange.lowerBound) ... max(aroundId.id, messageRange.upperBound)
|
||||
strictFilledIndices = IndexSet(integersIn: Int(min(aroundId.id, messageRange.lowerBound)) ... Int(max(aroundId.id, messageRange.upperBound)))
|
||||
var shouldFillAround = false
|
||||
if peerInput.requestThreadId(accountPeerId: accountPeerId) != nil {
|
||||
shouldFillAround = true
|
||||
}
|
||||
if case .customTag = space {
|
||||
shouldFillAround = true
|
||||
}
|
||||
|
||||
if shouldFillAround {
|
||||
if ids.count <= count / 2 - 1 {
|
||||
filledRange = minMaxRange
|
||||
}
|
||||
|
@ -157,9 +157,12 @@ private final class ManagedMessageHistoryHolesContext {
|
||||
}*/
|
||||
|
||||
for entry in entries {
|
||||
if self.completedEntries[entry] != nil {
|
||||
if let previousTimestamp = self.completedEntries[entry] {
|
||||
if previousTimestamp >= CFAbsoluteTimeGetCurrent() - 20.0 {
|
||||
Logger.shared.log("ManagedMessageHistoryHoles", "Not adding recently finished entry \(entry)")
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
switch entry.hole {
|
||||
case let .peer(peerHole):
|
||||
|
@ -2539,7 +2539,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
return
|
||||
}
|
||||
inlineSearchResultsView.alpha = 1.0
|
||||
inlineSearchResultsView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.25)
|
||||
inlineSearchResultsView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||
inlineSearchResultsView.animateIn()
|
||||
|
||||
transition.updateSublayerTransformScale(node: self.historyNodeContainer, scale: CGPoint(x: 0.95, y: 0.95))
|
||||
|
@ -5,6 +5,7 @@ import SwiftSignalKit
|
||||
import Display
|
||||
import AsyncDisplayKit
|
||||
import TelegramCore
|
||||
import Postbox
|
||||
import TelegramPresentationData
|
||||
import TelegramUIPreferences
|
||||
import MediaResources
|
||||
@ -1560,6 +1561,59 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
|
||||
}
|
||||
|
||||
initialData = combinedInitialData
|
||||
|
||||
if resetScrolling, let previousViewValue = previousView.with({ $0 })?.0 {
|
||||
let filteredEntries: [ChatHistoryEntry] = []
|
||||
let processedView = ChatHistoryView(originalView: MessageHistoryView(tag: nil, namespaces: .all, entries: [], holeEarlier: false, holeLater: false, isLoading: true), filteredEntries: filteredEntries, associatedData: previousViewValue.associatedData, lastHeaderId: 0, id: previousViewValue.id, locationInput: previousViewValue.locationInput, ignoreMessagesInTimestampRange: nil)
|
||||
let previousValueAndVersion = previousView.swap((processedView, update.1, selectedMessages, allAdMessages.version))
|
||||
let previous = previousValueAndVersion?.0
|
||||
let previousSelectedMessages = previousValueAndVersion?.2
|
||||
|
||||
if let previousVersion = previousValueAndVersion?.1 {
|
||||
assert(update.1 >= previousVersion)
|
||||
}
|
||||
|
||||
var reason: ChatHistoryViewTransitionReason
|
||||
reason = ChatHistoryViewTransitionReason.InteractiveChanges
|
||||
|
||||
let disableAnimations = true
|
||||
let forceSynchronous = true
|
||||
|
||||
let rawTransition = preparedChatHistoryViewTransition(from: previous, to: processedView, reason: reason, reverse: false, chatLocation: chatLocation, controllerInteraction: controllerInteraction, scrollPosition: nil, scrollAnimationCurve: nil, initialData: initialData?.initialData, keyboardButtonsMessage: nil, cachedData: initialData?.cachedData, cachedDataMessages: initialData?.cachedDataMessages, readStateData: initialData?.readStateData, flashIndicators: false, updatedMessageSelection: previousSelectedMessages != selectedMessages, messageTransitionNode: messageTransitionNode(), allUpdated: false)
|
||||
var mappedTransition = mappedChatHistoryViewListTransition(context: context, chatLocation: chatLocation, associatedData: previousViewValue.associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: 0, animateFromPreviousFilter: resetScrolling, transition: rawTransition)
|
||||
|
||||
if disableAnimations {
|
||||
mappedTransition.options.remove(.AnimateInsertion)
|
||||
mappedTransition.options.remove(.AnimateAlpha)
|
||||
mappedTransition.options.remove(.AnimateTopItemPosition)
|
||||
mappedTransition.options.remove(.RequestItemInsertionAnimations)
|
||||
}
|
||||
if forceSynchronous || resetScrolling {
|
||||
mappedTransition.options.insert(.Synchronous)
|
||||
}
|
||||
if resetScrolling {
|
||||
mappedTransition.options.insert(.AnimateAlpha)
|
||||
mappedTransition.options.insert(.AnimateFullTransition)
|
||||
}
|
||||
|
||||
if resetScrolling {
|
||||
resetScrolling = false
|
||||
}
|
||||
|
||||
Queue.mainQueue().async {
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
if strongSelf.appliedPlayingMessageId?.0 != currentlyPlayingMessageIdAndType?.0 {
|
||||
strongSelf.appliedPlayingMessageId = currentlyPlayingMessageIdAndType
|
||||
}
|
||||
if strongSelf.appliedScrollToMessageId != scrollToMessageId {
|
||||
strongSelf.appliedScrollToMessageId = scrollToMessageId
|
||||
}
|
||||
strongSelf.enqueueHistoryViewTransition(mappedTransition)
|
||||
}
|
||||
}
|
||||
|
||||
Queue.mainQueue().async {
|
||||
if let strongSelf = self {
|
||||
if !strongSelf.didSetInitialData {
|
||||
|
@ -37,6 +37,8 @@ func preloadedChatHistoryViewForLocation(_ location: ChatHistoryLocationInput, c
|
||||
}
|
||||
|
||||
func chatHistoryViewForLocation(_ location: ChatHistoryLocationInput, ignoreMessagesInTimestampRange: ClosedRange<Int32>?, context: AccountContext, chatLocation: ChatLocation, chatLocationContextHolder: Atomic<ChatLocationContextHolder?>, scheduled: Bool, fixedCombinedReadStates: MessageHistoryViewReadState?, tag: HistoryViewInputTag?, appendMessagesFromTheSameGroup: Bool, additionalData: [AdditionalMessageHistoryViewData], orderStatistics: MessageHistoryViewOrderStatistics = []) -> Signal<ChatHistoryViewUpdate, NoError> {
|
||||
print("request \(location.content)")
|
||||
|
||||
let account = context.account
|
||||
if scheduled {
|
||||
var first = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user