mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-08 19:10:53 +00:00
Various improvements
This commit is contained in:
parent
effaa875a6
commit
6405f365a9
@ -1437,6 +1437,7 @@ private final class ProfileGiftsContextImpl {
|
||||
let postbox = self.account.postbox
|
||||
let filter = self.filter
|
||||
let sorting = self.sorting
|
||||
let limit = self.limit
|
||||
|
||||
let isFiltered = self.filter != .All || self.sorting != .date
|
||||
if !isFiltered {
|
||||
@ -1524,7 +1525,7 @@ private final class ProfileGiftsContextImpl {
|
||||
if !filter.contains(.unique) {
|
||||
flags |= (1 << 4)
|
||||
}
|
||||
return network.request(Api.functions.payments.getSavedStarGifts(flags: flags, peer: inputPeer, collectionId: collectionId, offset: initialNextOffset ?? "", limit: 36))
|
||||
return network.request(Api.functions.payments.getSavedStarGifts(flags: flags, peer: inputPeer, collectionId: collectionId, offset: initialNextOffset ?? "", limit: limit))
|
||||
|> map(Optional.init)
|
||||
|> `catch` { _ -> Signal<Api.payments.SavedStarGifts?, NoError> in
|
||||
return .single(nil)
|
||||
@ -3013,7 +3014,6 @@ private final class ResaleGiftsContextImpl {
|
||||
let network = self.account.network
|
||||
let postbox = self.account.postbox
|
||||
let sorting = self.sorting
|
||||
let limit = self.limit
|
||||
let filterAttributes = self.filterAttributes
|
||||
let currentAttributesHash = self.attributesHash
|
||||
|
||||
@ -3053,7 +3053,7 @@ private final class ResaleGiftsContextImpl {
|
||||
let attributesHash = currentAttributesHash ?? 0
|
||||
flags |= (1 << 0)
|
||||
|
||||
let signal = network.request(Api.functions.payments.getResaleStarGifts(flags: flags, attributesHash: attributesHash, giftId: giftId, attributes: apiAttributes, offset: initialNextOffset ?? "", limit: limit))
|
||||
let signal = network.request(Api.functions.payments.getResaleStarGifts(flags: flags, attributesHash: attributesHash, giftId: giftId, attributes: apiAttributes, offset: initialNextOffset ?? "", limit: 36))
|
||||
|> map(Optional.init)
|
||||
|> `catch` { _ -> Signal<Api.payments.ResaleStarGifts?, NoError> in
|
||||
return .single(nil)
|
||||
|
@ -277,13 +277,17 @@ final class OverlayAudioPlayerControllerNode: ViewControllerTracingNode, ASGestu
|
||||
}
|
||||
|
||||
self.historyNode.endedInteractiveDragging = { [weak self] _ in
|
||||
guard let strongSelf = self else {
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
switch strongSelf.historyNode.visibleContentOffset() {
|
||||
switch self.historyNode.visibleContentOffset() {
|
||||
case let .known(value):
|
||||
if value <= -10.0 {
|
||||
strongSelf.requestDismiss()
|
||||
if let playlistLocation = self.playlistLocation as? PeerMessagesPlaylistLocation, case let .savedMusic(_, _, canReorder) = playlistLocation, canReorder {
|
||||
|
||||
} else {
|
||||
if value <= -10.0 {
|
||||
self.requestDismiss()
|
||||
}
|
||||
}
|
||||
default:
|
||||
break
|
||||
@ -507,7 +511,6 @@ final class OverlayAudioPlayerControllerNode: ViewControllerTracingNode, ASGestu
|
||||
return .single(true)
|
||||
}
|
||||
})
|
||||
self.historyNode.useMainQueueTransactions = false
|
||||
self.historyNode.autoScrollWhenReordering = false
|
||||
}
|
||||
|
||||
@ -689,7 +692,6 @@ final class OverlayAudioPlayerControllerNode: ViewControllerTracingNode, ASGestu
|
||||
insets.top = max(0.0, listNodeSize.height - floor(56.0 * 3.5))
|
||||
|
||||
var itemOffsetInsets = insets
|
||||
|
||||
if let playlistLocation = self.playlistLocation as? PeerMessagesPlaylistLocation, case let .savedMusic(_, _, canReorder) = playlistLocation, canReorder {
|
||||
itemOffsetInsets.top = 0.0
|
||||
itemOffsetInsets.bottom = 0.0
|
||||
@ -998,9 +1000,16 @@ final class OverlayAudioPlayerControllerNode: ViewControllerTracingNode, ASGestu
|
||||
|
||||
insets.top = max(0.0, listNodeSize.height - floor(56.0 * 3.5))
|
||||
|
||||
var itemOffsetInsets = insets
|
||||
if let playlistLocation = self.playlistLocation as? PeerMessagesPlaylistLocation, case let .savedMusic(_, _, canReorder) = playlistLocation, canReorder {
|
||||
itemOffsetInsets.top = 0.0
|
||||
itemOffsetInsets.bottom = 0.0
|
||||
insets = itemOffsetInsets
|
||||
}
|
||||
|
||||
self.historyNode.frame = CGRect(origin: CGPoint(x: 0.0, y: listTopInset), size: listNodeSize)
|
||||
|
||||
let updateSizeAndInsets = ListViewUpdateSizeAndInsets(size: listNodeSize, insets: insets, duration: 0.0, curve: .Default(duration: nil))
|
||||
let updateSizeAndInsets = ListViewUpdateSizeAndInsets(size: listNodeSize, insets: insets, itemOffsetInsets: itemOffsetInsets, duration: 0.0, curve: .Default(duration: nil))
|
||||
self.historyNode.updateLayout(transition: .immediate, updateSizeAndInsets: updateSizeAndInsets)
|
||||
|
||||
self.historyNode.recursivelyEnsureDisplaySynchronously(true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user