mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 03:40:18 +00:00
Various fixes
This commit is contained in:
parent
ab2e83fb66
commit
55f21fc518
@ -1210,7 +1210,7 @@ public func channelStatsController(context: AccountContext, updatedPresentationD
|
|||||||
updateState { $0.withUpdatedGiftsSelected(selected).withUpdatedBoostersExpanded(false) }
|
updateState { $0.withUpdatedGiftsSelected(selected).withUpdatedBoostersExpanded(false) }
|
||||||
})
|
})
|
||||||
|
|
||||||
let messageView = context.account.viewTracker.aroundMessageHistoryViewForLocation(.peer(peerId: peerId, threadId: nil), index: .upperBound, anchorIndex: .upperBound, count: 100, fixedCombinedReadStates: nil)
|
let messageView = context.account.viewTracker.aroundMessageHistoryViewForLocation(.peer(peerId: peerId, threadId: nil), index: .upperBound, anchorIndex: .upperBound, count: 200, fixedCombinedReadStates: nil)
|
||||||
|> map { messageHistoryView, _, _ -> MessageHistoryView? in
|
|> map { messageHistoryView, _, _ -> MessageHistoryView? in
|
||||||
return messageHistoryView
|
return messageHistoryView
|
||||||
}
|
}
|
||||||
@ -1262,7 +1262,19 @@ public func channelStatsController(context: AccountContext, updatedPresentationD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let messages = messageView?.entries.map { $0.message }.sorted(by: { (lhsMessage, rhsMessage) -> Bool in
|
var existingGroupingKeys = Set<Int64>()
|
||||||
|
var idsToFilter = Set<MessageId>()
|
||||||
|
var messages = messageView?.entries.map { $0.message } ?? []
|
||||||
|
for message in messages {
|
||||||
|
if let groupingKey = message.groupingKey {
|
||||||
|
if existingGroupingKeys.contains(groupingKey) {
|
||||||
|
idsToFilter.insert(message.id)
|
||||||
|
} else {
|
||||||
|
existingGroupingKeys.insert(groupingKey)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
messages = messages.filter { !idsToFilter.contains($0.id) }.sorted(by: { (lhsMessage, rhsMessage) -> Bool in
|
||||||
return lhsMessage.timestamp > rhsMessage.timestamp
|
return lhsMessage.timestamp > rhsMessage.timestamp
|
||||||
})
|
})
|
||||||
let interactions = data?.postInteractions.reduce([ChannelStatsPostInteractions.PostId : ChannelStatsPostInteractions]()) { (map, interactions) -> [ChannelStatsPostInteractions.PostId : ChannelStatsPostInteractions] in
|
let interactions = data?.postInteractions.reduce([ChannelStatsPostInteractions.PostId : ChannelStatsPostInteractions]()) { (map, interactions) -> [ChannelStatsPostInteractions.PostId : ChannelStatsPostInteractions] in
|
||||||
|
|||||||
@ -1054,10 +1054,13 @@ final class MediaEditorScreenComponent: Component {
|
|||||||
if case let .video(_, _, _, additionalPath, _, _, _, _, _) = subject, additionalPath != nil {
|
if case let .video(_, _, _, additionalPath, _, _, _, _, _) = subject, additionalPath != nil {
|
||||||
canRecordVideo = false
|
canRecordVideo = false
|
||||||
}
|
}
|
||||||
}
|
if case let .asset(asset) = subject, asset.mediaType == .image {
|
||||||
if "".isEmpty {
|
|
||||||
canRecordVideo = false
|
canRecordVideo = false
|
||||||
}
|
}
|
||||||
|
if case .image = subject {
|
||||||
|
canRecordVideo = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.inputPanel.parentState = state
|
self.inputPanel.parentState = state
|
||||||
let inputPanelSize = self.inputPanel.update(
|
let inputPanelSize = self.inputPanel.update(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user