mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various fixes
This commit is contained in:
parent
e7722d7b29
commit
629f2b1e5d
3 changed files with 10 additions and 8 deletions
|
|
@ -1346,7 +1346,7 @@ private final class ChatMessagePollOptionNode: ASDisplayNode {
|
|||
node.buttonNode.isAccessibilityElement = shouldHaveRadioNode
|
||||
|
||||
let previousResultBarWidth = minBarWidth + floor((width - leftInset - rightInset - minBarWidth) * (currentResult?.normalized ?? 0.0))
|
||||
let previousFrame = CGRect(origin: CGPoint(x: leftInset, y: contentLayoutHeight - 6.0 - 1.0), size: CGSize(width: previousResultBarWidth, height: 6.0))
|
||||
let previousFrame = CGRect(origin: CGPoint(x: leftInset, y: contentLayoutHeight - 6.0 - 1.0), size: CGSize(width: previousResultBarWidth, height: 4.0))
|
||||
|
||||
node.resultBarNode.layer.animateSpring(from: NSValue(cgPoint: previousFrame.center), to: NSValue(cgPoint: node.resultBarNode.frame.center), keyPath: "position", duration: 0.6, damping: 110.0)
|
||||
node.resultBarNode.layer.animateSpring(from: NSValue(cgRect: CGRect(origin: CGPoint(), size: previousFrame.size)), to: NSValue(cgRect: CGRect(origin: CGPoint(), size: node.resultBarNode.frame.size)), keyPath: "bounds", duration: 0.6, damping: 110.0)
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ final class StoryContentCaptionComponent: Component {
|
|||
let textSelectionAction: (NSAttributedString, TextSelectionAction) -> Void
|
||||
let controller: () -> ViewController?
|
||||
let openStory: (EnginePeer, EngineStoryItem?) -> Void
|
||||
let openMusic: (FileMediaReference, UIView) -> Void
|
||||
let openMusic: (TelegramMediaFile, UIView) -> Void
|
||||
|
||||
init(
|
||||
externalState: ExternalState,
|
||||
|
|
@ -89,7 +89,7 @@ final class StoryContentCaptionComponent: Component {
|
|||
textSelectionAction: @escaping (NSAttributedString, TextSelectionAction) -> Void,
|
||||
controller: @escaping () -> ViewController?,
|
||||
openStory: @escaping (EnginePeer, EngineStoryItem?) -> Void,
|
||||
openMusic: @escaping (FileMediaReference, UIView) -> Void
|
||||
openMusic: @escaping (TelegramMediaFile, UIView) -> Void
|
||||
) {
|
||||
self.externalState = externalState
|
||||
self.context = context
|
||||
|
|
@ -756,7 +756,7 @@ final class StoryContentCaptionComponent: Component {
|
|||
return
|
||||
}
|
||||
if let sourceView = self.musicPanel?.view {
|
||||
self.component?.openMusic(.standalone(media: music), sourceView)
|
||||
self.component?.openMusic(music, sourceView)
|
||||
}
|
||||
},
|
||||
animateScale: false
|
||||
|
|
|
|||
|
|
@ -7547,8 +7547,8 @@ public final class StoryItemSetContainerComponent: Component {
|
|||
})
|
||||
}
|
||||
|
||||
private func performMusicAction(file: FileMediaReference, sourceView: UIView, gesture: ContextGesture?) {
|
||||
guard let component = self.component, let controller = component.controller() else {
|
||||
private func performMusicAction(file: TelegramMediaFile, sourceView: UIView, gesture: ContextGesture?) {
|
||||
guard let component = self.component, let controller = component.controller(), let peer = PeerReference(component.slice.peer._asPeer()) else {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -7556,6 +7556,8 @@ public final class StoryItemSetContainerComponent: Component {
|
|||
|
||||
let presentationData = component.context.sharedContext.currentPresentationData.with({ $0 }).withUpdated(theme: component.theme)
|
||||
|
||||
let fileReference: FileMediaReference = .story(peer: peer, id: component.slice.item.storyItem.id, media: file)
|
||||
|
||||
let items = component.context.engine.peers.savedMusicIds()
|
||||
|> take(1)
|
||||
|> map { [weak self] savedIds -> ContextController.Items in
|
||||
|
|
@ -7580,7 +7582,7 @@ public final class StoryItemSetContainerComponent: Component {
|
|||
return
|
||||
}
|
||||
|
||||
let _ = component.context.engine.peers.addSavedMusic(file: file).start()
|
||||
let _ = component.context.engine.peers.addSavedMusic(file: fileReference).start()
|
||||
|
||||
guard let controller = component.controller() as? StoryContainerScreen else {
|
||||
return
|
||||
|
|
@ -7638,7 +7640,7 @@ public final class StoryItemSetContainerComponent: Component {
|
|||
return
|
||||
}
|
||||
|
||||
let _ = component.context.engine.messages.enqueueOutgoingMessage(to: component.context.account.peerId, replyTo: nil, content: .file(file)).start()
|
||||
let _ = component.context.engine.messages.enqueueOutgoingMessage(to: component.context.account.peerId, replyTo: nil, content: .file(fileReference)).start()
|
||||
|
||||
guard let controller = component.controller() as? StoryContainerScreen else {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue