diff --git a/submodules/ChatListUI/Sources/ChatListController.swift b/submodules/ChatListUI/Sources/ChatListController.swift index cd196c2e37..53b9c56dc3 100644 --- a/submodules/ChatListUI/Sources/ChatListController.swift +++ b/submodules/ChatListUI/Sources/ChatListController.swift @@ -2540,6 +2540,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController return nil } + private weak var storyCameraTooltip: TooltipScreen? fileprivate func openStoryCamera(fromList: Bool) { var reachedCountLimit = false var premiumNeeded = false @@ -2575,6 +2576,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController } if reachedCountLimit || premiumNeeded || hasActiveCall || hasActiveGroupCall { + if let storyCameraTooltip = self.storyCameraTooltip { + self.storyCameraTooltip = nil + storyCameraTooltip.dismiss() + } if let componentView = self.chatListHeaderView() { var sourceFrame: CGRect? if fromList { @@ -2626,6 +2631,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController } } ) + self.storyCameraTooltip = tooltipController self.present(tooltipController, in: .window(.root)) } } diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift index 6de5f65225..914f23e282 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift @@ -2468,7 +2468,7 @@ public final class StoryItemSetContainerComponent: Component { privacyIcon = ComponentView() self.privacyIcon = privacyIcon } - let closeFriendIconSize = privacyIcon.update( + let privacyIconSize = privacyIcon.update( transition: privacyIconTransition, component: AnyComponent(PlainButtonComponent( content: AnyComponent( @@ -2504,7 +2504,7 @@ public final class StoryItemSetContainerComponent: Component { let tooltipScreen = TooltipScreen( account: component.context.account, sharedContext: component.context.sharedContext, - text: .plain(text: tooltipText), style: .default, location: TooltipScreen.Location.point(closeFriendIconView.convert(closeFriendIconView.bounds, to: self).offsetBy(dx: 1.0, dy: 6.0), .top), displayDuration: .infinite, shouldDismissOnTouch: { _, _ in + text: .plain(text: tooltipText), style: .default, location: TooltipScreen.Location.point(closeFriendIconView.convert(closeFriendIconView.bounds, to: nil).offsetBy(dx: 1.0, dy: 6.0), .top), displayDuration: .infinite, shouldDismissOnTouch: { _, _ in return .dismiss(consume: true) } ) @@ -2524,7 +2524,7 @@ public final class StoryItemSetContainerComponent: Component { environment: {}, containerSize: CGSize(width: 44.0, height: 44.0) ) - let closeFriendIconFrame = CGRect(origin: CGPoint(x: headerRightOffset - closeFriendIconSize.width - 8.0, y: 23.0), size: closeFriendIconSize) + let closeFriendIconFrame = CGRect(origin: CGPoint(x: headerRightOffset - privacyIconSize.width - 8.0, y: 22.0), size: privacyIconSize) if let closeFriendIconView = privacyIcon.view { if closeFriendIconView.superview == nil { self.controlsContainerView.addSubview(closeFriendIconView)