Various fixes

This commit is contained in:
Ilya Laktyushin 2023-07-18 18:29:29 +02:00
parent 0220c4ca14
commit 4375a373c0
2 changed files with 9 additions and 3 deletions

View File

@ -2540,6 +2540,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
return nil return nil
} }
private weak var storyCameraTooltip: TooltipScreen?
fileprivate func openStoryCamera(fromList: Bool) { fileprivate func openStoryCamera(fromList: Bool) {
var reachedCountLimit = false var reachedCountLimit = false
var premiumNeeded = false var premiumNeeded = false
@ -2575,6 +2576,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
} }
if reachedCountLimit || premiumNeeded || hasActiveCall || hasActiveGroupCall { if reachedCountLimit || premiumNeeded || hasActiveCall || hasActiveGroupCall {
if let storyCameraTooltip = self.storyCameraTooltip {
self.storyCameraTooltip = nil
storyCameraTooltip.dismiss()
}
if let componentView = self.chatListHeaderView() { if let componentView = self.chatListHeaderView() {
var sourceFrame: CGRect? var sourceFrame: CGRect?
if fromList { if fromList {
@ -2626,6 +2631,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
} }
} }
) )
self.storyCameraTooltip = tooltipController
self.present(tooltipController, in: .window(.root)) self.present(tooltipController, in: .window(.root))
} }
} }

View File

@ -2468,7 +2468,7 @@ public final class StoryItemSetContainerComponent: Component {
privacyIcon = ComponentView() privacyIcon = ComponentView()
self.privacyIcon = privacyIcon self.privacyIcon = privacyIcon
} }
let closeFriendIconSize = privacyIcon.update( let privacyIconSize = privacyIcon.update(
transition: privacyIconTransition, transition: privacyIconTransition,
component: AnyComponent(PlainButtonComponent( component: AnyComponent(PlainButtonComponent(
content: AnyComponent( content: AnyComponent(
@ -2504,7 +2504,7 @@ public final class StoryItemSetContainerComponent: Component {
let tooltipScreen = TooltipScreen( let tooltipScreen = TooltipScreen(
account: component.context.account, account: component.context.account,
sharedContext: component.context.sharedContext, 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) return .dismiss(consume: true)
} }
) )
@ -2524,7 +2524,7 @@ public final class StoryItemSetContainerComponent: Component {
environment: {}, environment: {},
containerSize: CGSize(width: 44.0, height: 44.0) 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 let closeFriendIconView = privacyIcon.view {
if closeFriendIconView.superview == nil { if closeFriendIconView.superview == nil {
self.controlsContainerView.addSubview(closeFriendIconView) self.controlsContainerView.addSubview(closeFriendIconView)