diff --git a/submodules/ChatSendMessageActionUI/Sources/ChatSendMessageActionSheetControllerNode.swift b/submodules/ChatSendMessageActionUI/Sources/ChatSendMessageActionSheetControllerNode.swift index b1a74d9c1f..acb23c3c16 100644 --- a/submodules/ChatSendMessageActionUI/Sources/ChatSendMessageActionSheetControllerNode.swift +++ b/submodules/ChatSendMessageActionUI/Sources/ChatSendMessageActionSheetControllerNode.swift @@ -688,7 +688,7 @@ final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode, sendButtonFrame.origin.y -= menuHeightWithInset } sendButtonFrame.origin.y = min(sendButtonFrame.origin.y + contentOffset, layout.size.height - layout.intrinsicInsets.bottom - initialSendButtonFrame.height) - transition.updateFrame(node: self.sendButtonNode, frame: sendButtonFrame) + transition.updateFrameAsPositionAndBounds(node: self.sendButtonNode, frame: sendButtonFrame) var messageFrame = self.textFieldFrame messageFrame.size.width += 32.0 diff --git a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift index c18e9897a3..2141c5d944 100644 --- a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift +++ b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift @@ -1316,14 +1316,14 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable { self.navigationItem.titleView = self.titleView - if case let .assets(collection, isStandalone) = self.subject { - if !isStandalone { - self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)) - } else if collection != nil { - self.navigationItem.leftBarButtonItem = UIBarButtonItem(backButtonAppearanceWithTitle: self.presentationData.strings.Common_Back, target: self, action: #selector(self.backPressed)) - } + if case let .assets(_, isStandalone) = self.subject, isStandalone { + self.navigationItem.leftBarButtonItem = UIBarButtonItem(backButtonAppearanceWithTitle: self.presentationData.strings.Common_Back, target: self, action: #selector(self.backPressed)) } else { - self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)) + if case let .assets(collection, _) = self.subject, collection != nil { + self.navigationItem.leftBarButtonItem = UIBarButtonItem(backButtonAppearanceWithTitle: self.presentationData.strings.Common_Back, target: self, action: #selector(self.backPressed)) + } else { + self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)) + } if self.bannedSendPhotos != nil && self.bannedSendVideos != nil { } else { @@ -1596,12 +1596,16 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable { } @objc private func backPressed() { - self.updateNavigationStack { current in - var mediaPickerContext: AttachmentMediaPickerContext? - if let first = current.first as? MediaPickerScreen { - mediaPickerContext = first.webSearchController?.mediaPickerContext ?? first.mediaPickerContext + if let _ = self.navigationController { + self.dismiss() + } else { + self.updateNavigationStack { current in + var mediaPickerContext: AttachmentMediaPickerContext? + if let first = current.first as? MediaPickerScreen { + mediaPickerContext = first.webSearchController?.mediaPickerContext ?? first.mediaPickerContext + } + return (current.filter { $0 !== self }, mediaPickerContext) } - return (current.filter { $0 !== self }, mediaPickerContext) } } diff --git a/submodules/TelegramUI/Sources/ChatTextInputActionButtonsNode.swift b/submodules/TelegramUI/Sources/ChatTextInputActionButtonsNode.swift index 8098585a0f..ac1c66b8f0 100644 --- a/submodules/TelegramUI/Sources/ChatTextInputActionButtonsNode.swift +++ b/submodules/TelegramUI/Sources/ChatTextInputActionButtonsNode.swift @@ -76,7 +76,7 @@ final class ChatTextInputActionButtonsNode: ASDisplayNode { } else { if highlighted { strongSelf.sendContainerNode.layer.animateScale(from: 1.0, to: 0.75, duration: 0.4, removeOnCompletion: false) - } else if let presentationLayer = strongSelf.sendButton.layer.presentation() { + } else if let presentationLayer = strongSelf.sendContainerNode.layer.presentation() { strongSelf.sendContainerNode.layer.animateScale(from: CGFloat((presentationLayer.value(forKeyPath: "transform.scale.y") as? NSNumber)?.floatValue ?? 1.0), to: 1.0, duration: 0.25, removeOnCompletion: false) } }