diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoStoryGridScreen/Sources/PeerInfoStoryGridScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoStoryGridScreen/Sources/PeerInfoStoryGridScreen.swift index b2ba55ea2f..5aae15186d 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoStoryGridScreen/Sources/PeerInfoStoryGridScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoStoryGridScreen/Sources/PeerInfoStoryGridScreen.swift @@ -53,7 +53,7 @@ final class PeerInfoStoryGridScreenComponent: Component { private weak var state: EmptyComponentState? private var environment: EnvironmentType? - private var paneNode: PeerInfoStoryPaneNode? + private(set) var paneNode: PeerInfoStoryPaneNode? private var paneStatusDisposable: Disposable? private(set) var paneStatusText: String? @@ -171,74 +171,6 @@ final class PeerInfoStoryGridScreenComponent: Component { self.environment?.controller()?.push(PeerInfoStoryGridScreen(context: component.context, peerId: component.peerId, scope: .archive)) }))) } - - /*if photoCount != 0 && videoCount != 0 { - items.append(.separator) - - let showPhotos: Bool - switch pane.contentType { - case .photo, .photoOrVideo: - showPhotos = true - default: - showPhotos = false - } - let showVideos: Bool - switch pane.contentType { - case .video, .photoOrVideo: - showVideos = true - default: - showVideos = false - } - - items.append(.action(ContextMenuActionItem(text: strings.SharedMedia_ShowPhotos, icon: { theme in - if !showPhotos { - return nil - } - return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Check"), color: theme.contextMenu.primaryColor) - }, action: { [weak pane] _, a in - a(.default) - - guard let pane = pane else { - return - } - let updatedContentType: PeerInfoVisualMediaPaneNode.ContentType - switch pane.contentType { - case .photoOrVideo: - updatedContentType = .video - case .photo: - updatedContentType = .photo - case .video: - updatedContentType = .photoOrVideo - default: - updatedContentType = pane.contentType - } - pane.updateContentType(contentType: updatedContentType) - }))) - items.append(.action(ContextMenuActionItem(text: strings.SharedMedia_ShowVideos, icon: { theme in - if !showVideos { - return nil - } - return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Check"), color: theme.contextMenu.primaryColor) - }, action: { [weak pane] _, a in - a(.default) - - guard let pane = pane else { - return - } - let updatedContentType: PeerInfoVisualMediaPaneNode.ContentType - switch pane.contentType { - case .photoOrVideo: - updatedContentType = .photo - case .photo: - updatedContentType = .photoOrVideo - case .video: - updatedContentType = .video - default: - updatedContentType = pane.contentType - } - pane.updateContentType(contentType: updatedContentType) - }))) - }*/ } let contextController = ContextController(account: component.context.account, presentationData: presentationData, source: .reference(PeerInfoContextReferenceContentSource(controller: controller, sourceNode: source)), items: .single(ContextController.Items(content: .list(items))), gesture: nil) @@ -554,8 +486,6 @@ public class PeerInfoStoryGridScreen: ViewControllerComponentContainer { } moreBarButton.addTarget(self, action: #selector(self.morePressed), forControlEvents: .touchUpInside) - self.navigationItem.setRightBarButton(moreBarButtonItem, animated: false) - self.titleView = ChatTitleView( context: context, theme: presentationData.theme, @@ -594,6 +524,8 @@ public class PeerInfoStoryGridScreen: ViewControllerComponentContainer { title = nil } self.titleView?.titleContent = .custom(presentationData.strings.StoryList_TitleSaved, title, false) + + self.navigationItem.setRightBarButton(self.moreBarButtonItem, animated: false) case .archive: guard let componentView = self.node.hostView.componentView as? PeerInfoStoryGridScreenComponent.View else { return @@ -605,6 +537,19 @@ public class PeerInfoStoryGridScreen: ViewControllerComponentContainer { title = presentationData.strings.StoryList_TitleArchive } self.titleView?.titleContent = .custom(title, nil, false) + + var hasMenu = false + if componentView.selectedCount != 0 { + hasMenu = true + } else if let paneNode = componentView.paneNode, !paneNode.isEmpty { + hasMenu = true + } + + if hasMenu { + self.navigationItem.setRightBarButton(self.moreBarButtonItem, animated: false) + } else { + self.navigationItem.setRightBarButton(nil, animated: false) + } } } diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/OpenStories.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/OpenStories.swift index 3394fe9f18..60e966250b 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/OpenStories.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/OpenStories.swift @@ -171,6 +171,13 @@ public extension StoryContainerScreen { |> take(1) |> mapToSignal { state -> Signal in if let slice = state.slice { + #if DEBUG && true + if "".isEmpty { + return .single(state) + |> delay(4.0, queue: .mainQueue()) + } + #endif + return waitUntilStoryMediaPreloaded(context: context, peerId: slice.peer.id, storyItem: slice.item.storyItem) |> timeout(4.0, queue: .mainQueue(), alternate: .complete()) |> map { _ -> StoryContentContextState in diff --git a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift index 59b6366829..73be5d761f 100644 --- a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift @@ -374,6 +374,7 @@ public final class StoryPeerListComponent: Component { self.scrollContainerView = UIView() self.scrollContainerView.clipsToBounds = true + self.scrollContainerView.isExclusiveTouch = true self.titleView = UIImageView() self.titleView.layer.anchorPoint = CGPoint(x: 0.0, y: 0.5) diff --git a/submodules/TgVoipWebrtc/tgcalls b/submodules/TgVoipWebrtc/tgcalls index ef358c48b0..ebc8452d3a 160000 --- a/submodules/TgVoipWebrtc/tgcalls +++ b/submodules/TgVoipWebrtc/tgcalls @@ -1 +1 @@ -Subproject commit ef358c48b05ccd59319a7ceded340b75baffa751 +Subproject commit ebc8452d3a0d0bc18822b4eb6ca61ec8fa7a70a5