From 0c9b15b18115cd71a3ca2a1d7c2a9599e449b7d4 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Tue, 22 Jul 2025 18:24:46 +0200 Subject: [PATCH] Fix menu --- .../Sources/PeerInfoStoryPaneNode.swift | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoStoryPaneNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoStoryPaneNode.swift index c3437605e5..2583e67945 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoStoryPaneNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoStoryPaneNode.swift @@ -3859,29 +3859,31 @@ public final class PeerInfoStoryPaneNode: ASDisplayNode, PeerInfoPaneNode, ASScr }))) } - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Rename Album", icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Edit"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in - guard let self else { - f(.default) - return - } + if self.canManageStories { + //TODO:localize + items.append(.action(ContextMenuActionItem(text: "Rename Album", icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Edit"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in + guard let self else { + f(.default) + return + } + + f(.dismissWithoutContent) + + self.presentRenameStoryFolder(id: folder.id, title: folder.title) + }))) - f(.dismissWithoutContent) - - self.presentRenameStoryFolder(id: folder.id, title: folder.title) - }))) - - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Share", icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Forward"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in - guard let self else { - f(.default) - return - } - - f(.dismissWithoutContent) - - self.shareFolder(id: folder.id) - }))) + //TODO:localize + items.append(.action(ContextMenuActionItem(text: "Share", icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Forward"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in + guard let self else { + f(.default) + return + } + + f(.dismissWithoutContent) + + self.shareFolder(id: folder.id) + }))) + } if self.canManageStories { //TODO:localize