diff --git a/submodules/ActionSheetPeerItem/Sources/ActionSheetPeerItem.swift b/submodules/ActionSheetPeerItem/Sources/ActionSheetPeerItem.swift index f51791dc87..03fc661474 100644 --- a/submodules/ActionSheetPeerItem/Sources/ActionSheetPeerItem.swift +++ b/submodules/ActionSheetPeerItem/Sources/ActionSheetPeerItem.swift @@ -41,6 +41,7 @@ public class ActionSheetPeerItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -132,8 +133,6 @@ public class ActionSheetPeerItemNode: ActionSheetItemNode { } self.accessibilityArea.accessibilityTraits = accessibilityTraits self.accessibilityArea.accessibilityLabel = item.title - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -155,7 +154,7 @@ public class ActionSheetPeerItemNode: ActionSheetItemNode { self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/BotPaymentsUI/Sources/BotCheckoutPaymentMethodSheet.swift b/submodules/BotPaymentsUI/Sources/BotCheckoutPaymentMethodSheet.swift index 0db79e9399..546a9e9a4d 100644 --- a/submodules/BotPaymentsUI/Sources/BotCheckoutPaymentMethodSheet.swift +++ b/submodules/BotPaymentsUI/Sources/BotCheckoutPaymentMethodSheet.swift @@ -133,6 +133,7 @@ public class BotCheckoutPaymentMethodItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -209,8 +210,6 @@ public class BotCheckoutPaymentMethodItemNode: ActionSheetItemNode { } else { self.checkNode.isHidden = true } - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -237,7 +236,7 @@ public class BotCheckoutPaymentMethodItemNode: ActionSheetItemNode { self.checkNode.frame = CGRect(origin: CGPoint(x: floor((44.0 - image.size.width) / 2.0), y: floor((size.height - image.size.height) / 2.0)), size: image.size) } - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/BotPaymentsUI/Sources/BotCheckoutPaymentShippingOptionSheetController.swift b/submodules/BotPaymentsUI/Sources/BotCheckoutPaymentShippingOptionSheetController.swift index c1f2cf5ca7..4f81f5d797 100644 --- a/submodules/BotPaymentsUI/Sources/BotCheckoutPaymentShippingOptionSheetController.swift +++ b/submodules/BotPaymentsUI/Sources/BotCheckoutPaymentShippingOptionSheetController.swift @@ -109,6 +109,7 @@ public class BotCheckoutPaymentShippingOptionItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -186,8 +187,6 @@ public class BotCheckoutPaymentShippingOptionItemNode: ActionSheetItemNode { } else { self.checkNode.isHidden = true } - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -209,7 +208,7 @@ public class BotCheckoutPaymentShippingOptionItemNode: ActionSheetItemNode { self.checkNode.frame = CGRect(origin: CGPoint(x: floor((44.0 - image.size.width) / 2.0), y: floor((size.height - image.size.height) / 2.0)), size: image.size) } - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift b/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift index ae63474a73..35dcdd68ed 100644 --- a/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift +++ b/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift @@ -133,7 +133,7 @@ private final class DateSelectionActionSheetItemNode: ActionSheetItemNode { self.pickerView.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/DeleteChatPeerActionSheetItem/Sources/DeleteChatPeerActionSheetItem.swift b/submodules/DeleteChatPeerActionSheetItem/Sources/DeleteChatPeerActionSheetItem.swift index 634dddd1ab..109ea09fbd 100644 --- a/submodules/DeleteChatPeerActionSheetItem/Sources/DeleteChatPeerActionSheetItem.swift +++ b/submodules/DeleteChatPeerActionSheetItem/Sources/DeleteChatPeerActionSheetItem.swift @@ -176,7 +176,7 @@ private final class DeleteChatPeerActionSheetItemNode: ActionSheetItemNode { let size = CGSize(width: constrainedSize.width, height: topInset + avatarSize + textSpacing + textSize.height + bottomInset) self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } } diff --git a/submodules/Display/Source/ActionSheetButtonItem.swift b/submodules/Display/Source/ActionSheetButtonItem.swift index c717a2d47c..749de57596 100644 --- a/submodules/Display/Source/ActionSheetButtonItem.swift +++ b/submodules/Display/Source/ActionSheetButtonItem.swift @@ -41,6 +41,7 @@ public class ActionSheetButtonItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -57,7 +58,7 @@ public class ActionSheetButtonNode: ActionSheetItemNode { private let accessibilityArea: AccessibilityAreaNode private var pointerInteraction: PointerInteraction? - + override public init(theme: ActionSheetControllerTheme) { self.theme = theme @@ -148,8 +149,6 @@ public class ActionSheetButtonNode: ActionSheetItemNode { accessibilityTraits.insert(.notEnabled) } self.accessibilityArea.accessibilityTraits = accessibilityTraits - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -161,7 +160,7 @@ public class ActionSheetButtonNode: ActionSheetItemNode { self.label.frame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - labelSize.width) / 2.0), y: floorToScreenPixels((size.height - labelSize.height) / 2.0)), size: labelSize) self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/Display/Source/ActionSheetCheckboxItem.swift b/submodules/Display/Source/ActionSheetCheckboxItem.swift index 9d932b0544..ec1828d03e 100644 --- a/submodules/Display/Source/ActionSheetCheckboxItem.swift +++ b/submodules/Display/Source/ActionSheetCheckboxItem.swift @@ -35,6 +35,7 @@ public class ActionSheetCheckboxItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -132,8 +133,6 @@ public class ActionSheetCheckboxItemNode: ActionSheetItemNode { accessibilityTraits.insert(.selected) } self.accessibilityArea.accessibilityTraits = accessibilityTraits - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -159,7 +158,7 @@ public class ActionSheetCheckboxItemNode: ActionSheetItemNode { self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/Display/Source/ActionSheetItemGroupsContainerNode.swift b/submodules/Display/Source/ActionSheetItemGroupsContainerNode.swift index c5eea6584c..35746efc72 100644 --- a/submodules/Display/Source/ActionSheetItemGroupsContainerNode.swift +++ b/submodules/Display/Source/ActionSheetItemGroupsContainerNode.swift @@ -7,7 +7,9 @@ final class ActionSheetItemGroupsContainerNode: ASDisplayNode { var theme: ActionSheetControllerTheme { didSet { self.setGroups(self.groups) - self.setNeedsLayout() + if let size = self.validSize { + let _ = self.updateLayout(constrainedSize: size, transition: .immediate) + } } } @@ -16,6 +18,8 @@ final class ActionSheetItemGroupsContainerNode: ASDisplayNode { var requestLayout: (() -> Void)? + private var validSize: CGSize? + init(theme: ActionSheetControllerTheme) { self.theme = theme @@ -46,6 +50,8 @@ final class ActionSheetItemGroupsContainerNode: ASDisplayNode { } func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { + self.validSize = constrainedSize + var groupsHeight: CGFloat = 0.0 var calculatedSizes: [CGSize] = [] diff --git a/submodules/Display/Source/ActionSheetItemNode.swift b/submodules/Display/Source/ActionSheetItemNode.swift index 87c81746ba..684245b258 100644 --- a/submodules/Display/Source/ActionSheetItemNode.swift +++ b/submodules/Display/Source/ActionSheetItemNode.swift @@ -11,6 +11,8 @@ open class ActionSheetItemNode: ASDisplayNode { public var requestLayout: (() -> Void)? + private var validSize: CGSize? + public init(theme: ActionSheetControllerTheme) { self.theme = theme @@ -28,13 +30,21 @@ open class ActionSheetItemNode: ASDisplayNode { open func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { let size = CGSize(width: constrainedSize.width, height: 57.0) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } - public func updateInternalLayout(_ calculatedSize: CGSize) { + public func updateInternalLayout(_ calculatedSize: CGSize, constrainedSize: CGSize) { + self.validSize = constrainedSize + self.backgroundNode.frame = CGRect(origin: CGPoint(), size: calculatedSize) self.overflowSeparatorNode.frame = CGRect(origin: CGPoint(x: 0.0, y: calculatedSize.height), size: CGSize(width: calculatedSize.width, height: UIScreenPixel)) self.overflowSeparatorNode.isHidden = !self.hasSeparator } + + public func requestLayoutUpdate() { + if let size = self.validSize { + let _ = self.updateLayout(constrainedSize: size, transition: .immediate) + } + } } diff --git a/submodules/Display/Source/ActionSheetSwitchItem.swift b/submodules/Display/Source/ActionSheetSwitchItem.swift index 81a532f15a..b9de851c4c 100644 --- a/submodules/Display/Source/ActionSheetSwitchItem.swift +++ b/submodules/Display/Source/ActionSheetSwitchItem.swift @@ -26,6 +26,7 @@ public class ActionSheetSwitchItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -99,8 +100,6 @@ public class ActionSheetSwitchNode: ActionSheetItemNode { accessibilityTraits.insert(.selected) } self.accessibilityArea.accessibilityTraits = accessibilityTraits - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -116,7 +115,7 @@ public class ActionSheetSwitchNode: ActionSheetItemNode { self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/Display/Source/ActionSheetTextItem.swift b/submodules/Display/Source/ActionSheetTextItem.swift index 90d13fa850..9d4fa2ced2 100644 --- a/submodules/Display/Source/ActionSheetTextItem.swift +++ b/submodules/Display/Source/ActionSheetTextItem.swift @@ -22,6 +22,7 @@ public class ActionSheetTextItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -65,8 +66,6 @@ public class ActionSheetTextNode: ActionSheetItemNode { self.label.attributedText = NSAttributedString(string: item.title, font: defaultFont, textColor: self.theme.secondaryTextColor, paragraphAlignment: .center) self.accessibilityArea.accessibilityLabel = item.title - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -77,7 +76,7 @@ public class ActionSheetTextNode: ActionSheetItemNode { self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } } diff --git a/submodules/OpenInExternalAppUI/Sources/OpenInActionSheetController.swift b/submodules/OpenInExternalAppUI/Sources/OpenInActionSheetController.swift index d3c226693b..4f62660b94 100644 --- a/submodules/OpenInExternalAppUI/Sources/OpenInActionSheetController.swift +++ b/submodules/OpenInExternalAppUI/Sources/OpenInActionSheetController.swift @@ -187,7 +187,7 @@ private final class OpenInActionSheetItemNode: ActionSheetItemNode { } } - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } } diff --git a/submodules/PeerInfoUI/Sources/ChannelBlacklistController.swift b/submodules/PeerInfoUI/Sources/ChannelBlacklistController.swift index 8668a35edb..b343ba58ac 100644 --- a/submodules/PeerInfoUI/Sources/ChannelBlacklistController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelBlacklistController.swift @@ -151,15 +151,15 @@ private enum ChannelBlacklistEntry: ItemListNodeEntry { func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelBlacklistControllerArguments switch self { - case let .add(theme, text): + case let .add(_, text): return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.addPeer() }) - case let .addInfo(theme, text): + case let .addInfo(_, text): return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) - case let .bannedHeader(theme, text): + case let .bannedHeader(_, text): return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) - case let .peerItem(theme, strings, dateTimeFormat, nameDisplayOrder, _, participant, editing, enabled): + case let .peerItem(_, strings, dateTimeFormat, nameDisplayOrder, _, participant, editing, enabled): var text: ItemListPeerItemText = .none switch participant.participant { case let .member(_, _, _, banInfo, _): diff --git a/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupActionSheetItem.swift b/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupActionSheetItem.swift index 529237a453..8a089dab3d 100644 --- a/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupActionSheetItem.swift +++ b/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupActionSheetItem.swift @@ -107,7 +107,7 @@ private final class ChannelDiscussionGroupActionSheetItemNode: ActionSheetItemNo let size = CGSize(width: constrainedSize.width, height: topInset + avatarSize + textSpacing + textSize.height + bottomInset) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } } diff --git a/submodules/PeerInfoUI/Sources/ChannelInfoController.swift b/submodules/PeerInfoUI/Sources/ChannelInfoController.swift index 81eb8c48aa..ae74d55458 100644 --- a/submodules/PeerInfoUI/Sources/ChannelInfoController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelInfoController.swift @@ -327,81 +327,81 @@ private enum ChannelInfoEntry: ItemListNodeEntry { func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelInfoControllerArguments switch self { - case let .info(theme, strings, dateTimeFormat, peer, cachedData, state, updatingAvatar): + case let .info(_, _, dateTimeFormat, peer, cachedData, state, updatingAvatar): return ItemListAvatarAndNameInfoItem(accountContext: arguments.context, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: nil, cachedData: cachedData, state: state, sectionId: self.section, style: .plain, editingNameUpdated: { editingName in arguments.updateEditingName(editingName) }, avatarTapped: { arguments.tapAvatarAction() }, context: arguments.avatarAndNameInfoContext, updatingImage: updatingAvatar) - case let .about(theme, text, value): + case let .about(_, text, value): return ItemListTextWithLabelItem(presentationData: presentationData, label: text, text: foldMultipleLineBreaks(value), enabledEntityTypes: [.allUrl, .mention, .hashtag], multiline: true, sectionId: self.section, action: nil, longTapAction: { arguments.displayContextMenu(ChannelInfoEntryTag.about, value) }, linkItemAction: { action, itemLink in arguments.aboutLinkAction(action, itemLink) }, tag: ChannelInfoEntryTag.about) - case let .addressName(theme, text, value): + case let .addressName(_, text, value): return ItemListTextWithLabelItem(presentationData: presentationData, label: text, text: "https://t.me/\(value)", textColor: .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { arguments.displayAddressNameContextMenu("https://t.me/\(value)") }, longTapAction: { arguments.displayContextMenu(ChannelInfoEntryTag.link, "https://t.me/\(value)") }, tag: ChannelInfoEntryTag.link) - case let .channelPhotoSetup(theme, text): + case let .channelPhotoSetup(_, text): return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.changeProfilePhoto() }) - case let .channelTypeSetup(theme, text, value): + case let .channelTypeSetup(_, text, value): return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openChannelTypeSetup() }) - case let .discussionGroupSetup(theme, text, value): + case let .discussionGroupSetup(_, text, value): return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openDiscussionGroupSetup() }) - case let .discussionGroupSetupInfo(theme, text): + case let .discussionGroupSetupInfo(_, text): return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) - case let .channelDescriptionSetup(theme, placeholder, value): + case let .channelDescriptionSetup(_, placeholder, value): return ItemListMultilineInputItem(presentationData: presentationData, text: value, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 255, display: true), sectionId: self.section, style: .plain, textUpdated: { updatedText in arguments.updateEditingDescriptionText(updatedText) }) - case let .admins(theme, text, value): + case let .admins(_, text, value): return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openAdmins() }) - case let .members(theme, text, value): + case let .members(_, text, value): return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openMembers() }) - case let .banned(theme, text, value): + case let .banned(_, text, value): return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openBanned() }) - case let .signMessages(theme, text, value): + case let .signMessages(_, text, value): return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .plain, updated: { updated in arguments.toggleSignatures(updated) }) - case let .signInfo(theme, text): + case let .signInfo(_, text): return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section, style: .plain) - case let .sharedMedia(theme, text): + case let .sharedMedia(_, text): return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .plain, action: { arguments.openSharedMedia() }) - case let .stats(theme, text): + case let .stats(_, text): return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .plain, action: { arguments.openStats() }) - case let .notifications(theme, text, value): + case let .notifications(_, text, value): return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.changeNotificationMuteSettings() }) - case let .report(theme, text): + case let .report(_, text): return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.reportChannel() }) - case let .leave(theme, text): + case let .leave(_, text): return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.leaveChannel() }) - case let .deleteChannel(theme, text): + case let .deleteChannel(_, text): return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.deleteChannel() }) @@ -529,7 +529,7 @@ private func channelInfoEntries(account: Account, presentationData: Presentation } } - if let _ = state.editingState, let adminRights = peer.adminRights { + if let _ = state.editingState, let _ = peer.adminRights { let discussionGroupTitle: String? if let cachedData = view.cachedData as? CachedChannelData { if case let .known(maybeLinkedDiscussionPeerId) = cachedData.linkedDiscussionPeerId, let linkedDiscussionPeerId = maybeLinkedDiscussionPeerId, let peer = view.peers[linkedDiscussionPeerId] { @@ -934,23 +934,14 @@ public func channelInfoController(context: AccountContext, peerId: PeerId) -> Vi globalNotificationSettings = settings } } - - var canManageChannel = false - if let peer = peer as? TelegramChannel { - if peer.flags.contains(.isCreator) { - canManageChannel = true - } else if let adminRights = peer.adminRights { - canManageChannel = true - } - } - + var canEditChannel = false var hasSomethingToEdit = false if let peer = view.peers[view.peerId] as? TelegramChannel { canEditChannel = peer.hasPermission(.changeInfo) if canEditChannel { hasSomethingToEdit = true - } else if let adminRights = peer.adminRights { + } else if let _ = peer.adminRights { if let cachedData = view.cachedData as? CachedChannelData, case let .known(maybeLinkedDiscussionPeerId) = cachedData.linkedDiscussionPeerId, let _ = maybeLinkedDiscussionPeerId { hasSomethingToEdit = true } diff --git a/submodules/PeerInfoUI/Sources/GroupStickerPackSetupController.swift b/submodules/PeerInfoUI/Sources/GroupStickerPackSetupController.swift index de91e5b228..63b90b8faf 100644 --- a/submodules/PeerInfoUI/Sources/GroupStickerPackSetupController.swift +++ b/submodules/PeerInfoUI/Sources/GroupStickerPackSetupController.swift @@ -211,7 +211,7 @@ private enum GroupStickerPackEntry: ItemListNodeEntry { func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! GroupStickerPackSetupControllerArguments switch self { - case let .search(theme, strings, prefix, placeholder, value): + case let .search(theme, _, prefix, placeholder, value): return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: prefix, textColor: theme.list.itemPrimaryTextColor), text: value, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), spacing: 0.0, clearType: .always, tag: nil, sectionId: self.section, textUpdated: { value in arguments.updateSearchText(value) }, processPaste: { text in @@ -223,11 +223,11 @@ private enum GroupStickerPackEntry: ItemListNodeEntry { } return text }, action: {}) - case let .searchInfo(theme, text): + case let .searchInfo(_, text): return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section, linkAction: nil) - case let .packsTitle(theme, text): + case let .packsTitle(_, text): return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) - case let .pack(_, theme, strings, info, topItem, count, playAnimatedStickers, selected): + case let .pack(_, _, _, info, topItem, count, playAnimatedStickers, selected): return ItemListStickerPackItem(presentationData: presentationData, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: false, control: selected ? .selection : .none, editing: ItemListStickerPackItemEditing(editable: false, editing: false, revealed: false, reorderable: false), enabled: true, playAnimatedStickers: playAnimatedStickers, sectionId: self.section, action: { if selected { arguments.openStickerPack(info) diff --git a/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift b/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift index b4e86fa6b3..b509fcbb70 100644 --- a/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift +++ b/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift @@ -116,7 +116,7 @@ private final class PeerBanTimeoutActionSheetItemNode: ActionSheetItemNode { self.pickerView.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/PeerInfoUI/Sources/ReportPeerDetailsActionSheetItem.swift b/submodules/PeerInfoUI/Sources/ReportPeerDetailsActionSheetItem.swift index 701e0bf00d..28c4cf0171 100644 --- a/submodules/PeerInfoUI/Sources/ReportPeerDetailsActionSheetItem.swift +++ b/submodules/PeerInfoUI/Sources/ReportPeerDetailsActionSheetItem.swift @@ -64,7 +64,7 @@ private final class ReportPeerDetailsActionSheetItemNode: ActionSheetItemNode { let size = CGSize(width: constrainedSize.width, height: inputHeight) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } } diff --git a/submodules/PeerInfoUI/Sources/ReportPeerHeaderActionSheetItem.swift b/submodules/PeerInfoUI/Sources/ReportPeerHeaderActionSheetItem.swift index cad6154e90..bc66fad77c 100644 --- a/submodules/PeerInfoUI/Sources/ReportPeerHeaderActionSheetItem.swift +++ b/submodules/PeerInfoUI/Sources/ReportPeerHeaderActionSheetItem.swift @@ -85,7 +85,7 @@ private final class ReportPeerHeaderActionSheetItemNode: ActionSheetItemNode { let size = CGSize(width: constrainedSize.width, height: topInset + iconSize.height + textSpacing + textSize.height + bottomInset) self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } } diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift index 80e0b493ec..84f39a47bc 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift @@ -256,7 +256,7 @@ private final class ProxyServerInfoItemNode: ActionSheetItemNode { offset += 36.0 } - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } } @@ -368,7 +368,7 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode { self.titleNode.frame = titleFrame self.activityIndicator.frame = CGRect(origin: CGPoint(x: 14.0, y: titleFrame.minY - 0.0), size: activitySize) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift b/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift index 60e0041f92..1a72c592be 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift @@ -120,7 +120,7 @@ private final class ThemeAutoNightTimeSelectionActionSheetItemNode: ActionSheetI self.pickerView.frame = CGRect(origin: CGPoint(), size: size) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/SyncCore/Sources/PixelDimensions.swift b/submodules/SyncCore/Sources/PixelDimensions.swift index c290ad3175..34f5ae0953 100644 --- a/submodules/SyncCore/Sources/PixelDimensions.swift +++ b/submodules/SyncCore/Sources/PixelDimensions.swift @@ -15,11 +15,11 @@ public struct PixelDimensions: Equatable { #if os(iOS) public extension PixelDimensions { - public init(_ size: CGSize) { + init(_ size: CGSize) { self.init(width: Int32(size.width), height: Int32(size.height)) } - public var cgSize: CGSize { + var cgSize: CGSize { return CGSize(width: CGFloat(self.width), height: CGFloat(self.height)) } } diff --git a/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift b/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift index 8e772b7f64..a652416203 100644 --- a/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift +++ b/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift @@ -42,6 +42,7 @@ public class LocationBroadcastActionSheetItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -108,8 +109,6 @@ public class LocationBroadcastActionSheetItemNode: ActionSheetItemNode { self.avatarNode.setPeer(context: item.context, theme: (item.context.sharedContext.currentPresentationData.with { $0 }).theme, peer: item.peer) self.timerNode.update(backgroundColor: self.theme.controlAccentColor.withAlphaComponent(0.4), foregroundColor: self.theme.controlAccentColor, textColor: self.theme.controlAccentColor, beginTimestamp: item.beginTimestamp, timeout: item.timeout, strings: item.strings) - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -128,7 +127,7 @@ public class LocationBroadcastActionSheetItemNode: ActionSheetItemNode { let timerSize = CGSize(width: 28.0, height: 28.0) self.timerNode.frame = CGRect(origin: CGPoint(x: size.width - 16.0 - timerSize.width, y: floorToScreenPixels((size.height - timerSize.height) / 2.0)), size: timerSize) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/TelegramCallsUI/Sources/CallRouteActionSheetItem.swift b/submodules/TelegramCallsUI/Sources/CallRouteActionSheetItem.swift index fa5cabaa20..5018893f4b 100644 --- a/submodules/TelegramCallsUI/Sources/CallRouteActionSheetItem.swift +++ b/submodules/TelegramCallsUI/Sources/CallRouteActionSheetItem.swift @@ -29,6 +29,7 @@ public class CallRouteActionSheetItem: ActionSheetItem { } node.setItem(self) + node.requestLayoutUpdate() } } @@ -132,8 +133,6 @@ public class CallRouteActionSheetItemNode: ActionSheetItemNode { } self.accessibilityArea.accessibilityTraits = accessibilityTraits self.accessibilityArea.accessibilityLabel = item.title - - self.setNeedsLayout() } public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize { @@ -152,7 +151,7 @@ public class CallRouteActionSheetItemNode: ActionSheetItemNode { self.checkNode.frame = CGRect(origin: CGPoint(x: size.width - image.size.width - 13.0, y: floor((size.height - image.size.height) / 2.0)), size: image.size) } - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/TelegramCore/Sources/ForwardGame.swift b/submodules/TelegramCore/Sources/ForwardGame.swift index 93dcd7b540..6627125458 100644 --- a/submodules/TelegramCore/Sources/ForwardGame.swift +++ b/submodules/TelegramCore/Sources/ForwardGame.swift @@ -5,7 +5,7 @@ import SwiftSignalKit public func forwardGameWithScore(account: Account, messageId: MessageId, to peerId: PeerId) -> Signal { return account.postbox.transaction { transaction -> Signal in - if let message = transaction.getMessage(messageId), let fromPeer = transaction.getPeer(messageId.peerId), let fromInputPeer = apiInputPeer(fromPeer), let toPeer = transaction.getPeer(peerId), let toInputPeer = apiInputPeer(toPeer) { + if let _ = transaction.getMessage(messageId), let fromPeer = transaction.getPeer(messageId.peerId), let fromInputPeer = apiInputPeer(fromPeer), let toPeer = transaction.getPeer(peerId), let toInputPeer = apiInputPeer(toPeer) { return account.network.request(Api.functions.messages.forwardMessages(flags: 1 << 8, fromPeer: fromInputPeer, id: [messageId.id], randomId: [arc4random64()], toPeer: toInputPeer, scheduleDate: nil)) |> map(Optional.init) |> `catch` { _ -> Signal in diff --git a/submodules/TelegramCore/Sources/InstantPage.swift b/submodules/TelegramCore/Sources/InstantPage.swift index 9366e88376..a6c168189c 100644 --- a/submodules/TelegramCore/Sources/InstantPage.swift +++ b/submodules/TelegramCore/Sources/InstantPage.swift @@ -79,7 +79,7 @@ extension InstantPageTableRow { extension InstantPageRelatedArticle { convenience init(apiRelatedArticle: Api.PageRelatedArticle) { switch apiRelatedArticle { - case let .pageRelatedArticle(flags, url, webpageId, title, description, photoId, author, publishedDate): + case let .pageRelatedArticle(_, url, webpageId, title, description, photoId, author, publishedDate): var posterPhotoId: MediaId? if let photoId = photoId { posterPhotoId = MediaId(namespace: Namespaces.Media.CloudImage, id: photoId) @@ -177,14 +177,14 @@ extension InstantPage { let url: String let views: Int32? switch apiPage { - case let .page(page): - url = page.url - blocks = page.blocks - photos = page.photos - files = page.documents - isComplete = (page.flags & (1 << 0)) == 0 - rtl = (page.flags & (1 << 1)) != 0 - views = page.views + case let .page(flags, pageUrl, pageBlocks, pagePhotos, pageDocuments, pageViews): + url = pageUrl + blocks = pageBlocks + photos = pagePhotos + files = pageDocuments + isComplete = (flags & (1 << 0)) == 0 + rtl = (flags & (1 << 1)) != 0 + views = pageViews } var media: [MediaId: Media] = [:] for photo in photos { diff --git a/submodules/TelegramCore/Sources/ManagedSecretChatOutgoingOperations.swift b/submodules/TelegramCore/Sources/ManagedSecretChatOutgoingOperations.swift index 71fed31221..e8cedadb60 100644 --- a/submodules/TelegramCore/Sources/ManagedSecretChatOutgoingOperations.swift +++ b/submodules/TelegramCore/Sources/ManagedSecretChatOutgoingOperations.swift @@ -584,8 +584,6 @@ private func decryptedAttributes73(_ attributes: [TelegramMediaFileAttribute], t break case .hintIsValidated: break - case .hintIsValidated: - break } } return result diff --git a/submodules/TelegramCore/Sources/StickerManagement.swift b/submodules/TelegramCore/Sources/StickerManagement.swift index e952f560ae..ab3da0cac2 100644 --- a/submodules/TelegramCore/Sources/StickerManagement.swift +++ b/submodules/TelegramCore/Sources/StickerManagement.swift @@ -99,7 +99,7 @@ public func preloadedFeaturedStickerSet(network: Network, postbox: Postbox, id: if let result = result { return postbox.transaction { transaction -> Void in if let pack = transaction.getOrderedItemListItem(collectionId: Namespaces.OrderedItemList.CloudFeaturedStickerPacks, itemId: FeaturedStickerPackItemId(id.id).rawValue)?.contents as? FeaturedStickerPackItem { - var items = result.items.map({ $0 as? StickerPackItem }).flatMap({ $0 }) + var items = result.items.map({ $0 as? StickerPackItem }).compactMap({ $0 }) if items.count > 5 { items.removeSubrange(5 ..< items.count) } diff --git a/submodules/TelegramCore/Sources/StickerPack.swift b/submodules/TelegramCore/Sources/StickerPack.swift index 1c50f6fa9e..c885316fdf 100644 --- a/submodules/TelegramCore/Sources/StickerPack.swift +++ b/submodules/TelegramCore/Sources/StickerPack.swift @@ -88,10 +88,10 @@ public func stickerPacksAttachedToMedia(account: Account, media: AnyMediaReferen |> mapToSignal { reference -> Signal<[Api.StickerSetCovered], MTRpcError> in let inputMedia: Api.InputStickeredMedia if let resource = reference.updatedResource as? TelegramCloudMediaResourceWithFileReference, let updatedReference = resource.fileReference { - if let imageReference = media.concrete(TelegramMediaImage.self), let reference = imageReference.media.reference, case let .cloud(imageId, accessHash, fileReference) = reference, let representation = largestImageRepresentation(imageReference.media.representations) { - inputMedia = .inputStickeredMediaPhoto(id: Api.InputPhoto.inputPhoto(id: imageId, accessHash: accessHash, fileReference: Buffer(data: updatedReference ?? Data()))) + if let imageReference = media.concrete(TelegramMediaImage.self), let reference = imageReference.media.reference, case let .cloud(imageId, accessHash, _) = reference, let representation = largestImageRepresentation(imageReference.media.representations) { + inputMedia = .inputStickeredMediaPhoto(id: Api.InputPhoto.inputPhoto(id: imageId, accessHash: accessHash, fileReference: Buffer(data: updatedReference))) } else if let fileReference = media.concrete(TelegramMediaFile.self), let resource = fileReference.media.resource as? CloudDocumentMediaResource { - inputMedia = .inputStickeredMediaDocument(id: Api.InputDocument.inputDocument(id: resource.fileId, accessHash: resource.accessHash, fileReference: Buffer(data: updatedReference ?? Data()))) + inputMedia = .inputStickeredMediaDocument(id: Api.InputDocument.inputDocument(id: resource.fileId, accessHash: resource.accessHash, fileReference: Buffer(data: updatedReference))) } else { return .single([]) } diff --git a/submodules/TelegramCore/Sources/StoreMessage_Telegram.swift b/submodules/TelegramCore/Sources/StoreMessage_Telegram.swift index 9757dfc05e..bb7bea2dc2 100644 --- a/submodules/TelegramCore/Sources/StoreMessage_Telegram.swift +++ b/submodules/TelegramCore/Sources/StoreMessage_Telegram.swift @@ -120,13 +120,13 @@ func apiMessagePeerId(_ messsage: Api.Message) -> PeerId? { case let .message(message): let chatPeerId = message.peerId return chatPeerId.peerId - case let .messageEmpty(_, id, peerId): + case let .messageEmpty(_, _, peerId): if let peerId = peerId { return peerId.peerId } else { return nil } - case let .messageService(flags, _, fromId, chatPeerId, _, _, _, _): + case let .messageService(_, _, _, chatPeerId, _, _, _, _): return chatPeerId.peerId } } @@ -185,7 +185,7 @@ func apiMessagePeerIds(_ message: Api.Message) -> [PeerId] { return result case .messageEmpty: return [] - case let .messageService(flags, _, fromId, chatPeerId, _, _, action, _): + case let .messageService(_, _, fromId, chatPeerId, _, _, action, _): let peerId: PeerId = chatPeerId.peerId var result = [peerId] diff --git a/submodules/TelegramCore/Sources/TelegramDeviceContactImportInfo.swift b/submodules/TelegramCore/Sources/TelegramDeviceContactImportInfo.swift index 46c4b21893..7d02ab0fa2 100644 --- a/submodules/TelegramCore/Sources/TelegramDeviceContactImportInfo.swift +++ b/submodules/TelegramCore/Sources/TelegramDeviceContactImportInfo.swift @@ -54,9 +54,8 @@ public func deviceContactsImportedByCount(postbox: Postbox, contacts: [(String, for (id, numbers) in contacts { var maxCount: Int32 = 0 for number in numbers { - if let value = transaction.getDeviceContactImportInfo(TelegramDeviceContactImportIdentifier.phoneNumber(number).key) as? TelegramDeviceContactImportedData, case let .imported(imported) = value { - - maxCount = max(maxCount, imported.importedByCount) + if let value = transaction.getDeviceContactImportInfo(TelegramDeviceContactImportIdentifier.phoneNumber(number).key) as? TelegramDeviceContactImportedData, case let .imported(_, importedByCount) = value { + maxCount = max(maxCount, importedByCount) } } if maxCount != 0 { diff --git a/submodules/TelegramCore/Sources/TelegramMediaWebDocument.swift b/submodules/TelegramCore/Sources/TelegramMediaWebDocument.swift index c27fafc5a1..5908010814 100644 --- a/submodules/TelegramCore/Sources/TelegramMediaWebDocument.swift +++ b/submodules/TelegramCore/Sources/TelegramMediaWebDocument.swift @@ -7,8 +7,8 @@ import SyncCore extension TelegramMediaWebFile { convenience init(_ document: Api.WebDocument) { switch document { - case let .webDocument(data): - self.init(resource: WebFileReferenceMediaResource(url: data.url, size: data.size, accessHash: data.accessHash), mimeType: data.mimeType, size: data.size, attributes: telegramMediaFileAttributesFromApiAttributes(data.attributes)) + case let .webDocument(url, accessHash, size, mimeType, attributes): + self.init(resource: WebFileReferenceMediaResource(url: url, size: size, accessHash: accessHash), mimeType: mimeType, size: size, attributes: telegramMediaFileAttributesFromApiAttributes(attributes)) case let .webDocumentNoProxy(url, size, mimeType, attributes): self.init(resource: HttpReferenceMediaResource(url: url, size: Int(size)), mimeType: mimeType, size: size, attributes: telegramMediaFileAttributesFromApiAttributes(attributes)) } diff --git a/submodules/TelegramCore/Sources/TelegramMediaWebpage.swift b/submodules/TelegramCore/Sources/TelegramMediaWebpage.swift index 3c50ba95b5..75e7098d06 100644 --- a/submodules/TelegramCore/Sources/TelegramMediaWebpage.swift +++ b/submodules/TelegramCore/Sources/TelegramMediaWebpage.swift @@ -6,7 +6,7 @@ import SyncCore func telegramMediaWebpageAttributeFromApiWebpageAttribute(_ attribute: Api.WebPageAttribute) -> TelegramMediaWebpageAttribute? { switch attribute { - case let .webPageAttributeTheme(flags, documents, settings): + case let .webPageAttributeTheme(_, documents, settings): var files: [TelegramMediaFile] = [] if let documents = documents { files = documents.compactMap { telegramMediaFileFromApiDocument($0) } diff --git a/submodules/TelegramCore/Sources/TermsOfService.swift b/submodules/TelegramCore/Sources/TermsOfService.swift index 9e5af7f4b0..e3514b3fe9 100644 --- a/submodules/TelegramCore/Sources/TermsOfService.swift +++ b/submodules/TelegramCore/Sources/TermsOfService.swift @@ -59,7 +59,7 @@ func managedTermsOfServiceUpdates(postbox: Postbox, network: Network, stateManag switch result { case let .termsOfServiceUpdate(_, termsOfService): updated = TermsOfServiceUpdate(apiTermsOfService: termsOfService) - case let .termsOfServiceUpdateEmpty(expires): + case .termsOfServiceUpdateEmpty: break } stateManager?.modifyTermsOfServiceUpdate { _ in diff --git a/submodules/TelegramCore/Sources/Theme.swift b/submodules/TelegramCore/Sources/Theme.swift index 7a421768a8..f2f41f65bc 100644 --- a/submodules/TelegramCore/Sources/Theme.swift +++ b/submodules/TelegramCore/Sources/Theme.swift @@ -10,8 +10,6 @@ extension TelegramTheme { switch apiTheme { case let .theme(flags, id, accessHash, slug, title, document, settings, installCount): self.init(id: id, accessHash: accessHash, slug: slug, title: title, file: document.flatMap(telegramMediaFileFromApiDocument), settings: settings.flatMap(TelegramThemeSettings.init(apiThemeSettings:)), isCreator: (flags & 1 << 0) != 0, isDefault: (flags & 1 << 1) != 0, installCount: installCount) - default: - return nil } } } @@ -49,14 +47,12 @@ extension TelegramBaseTheme { extension TelegramThemeSettings { convenience init?(apiThemeSettings: Api.ThemeSettings) { switch apiThemeSettings { - case let .themeSettings(flags, baseTheme, accentColor, messageTopColor, messageBottomColor, wallpaper): + case let .themeSettings(_, baseTheme, accentColor, messageTopColor, messageBottomColor, wallpaper): var messageColors: (UInt32, UInt32)? if let messageTopColor = messageTopColor, let messageBottomColor = messageBottomColor { messageColors = (UInt32(bitPattern: messageTopColor), UInt32(bitPattern: messageBottomColor)) } - self.init(baseTheme: TelegramBaseTheme(apiBaseTheme: baseTheme) ?? .classic, accentColor: UInt32(bitPattern: accentColor), messageColors: messageColors, wallpaper: wallpaper.flatMap(TelegramWallpaper.init(apiWallpaper:))) - default: - return nil + self.init(baseTheme: TelegramBaseTheme(apiBaseTheme: baseTheme), accentColor: UInt32(bitPattern: accentColor), messageColors: messageColors, wallpaper: wallpaper.flatMap(TelegramWallpaper.init(apiWallpaper:))) } } diff --git a/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift b/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift index 0c7da9f0a3..e2688bf0ba 100644 --- a/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift +++ b/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift @@ -108,7 +108,7 @@ private final class ChatDateSelectorItemNode: ActionSheetItemNode { self.pickerView.frame = CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: 180.0)) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift index 8d889ae214..6a419c78a7 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift @@ -590,7 +590,7 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState f(.default) }))) - if isSpeakSelectionEnabled() { + if isSpeakSelectionEnabled() && !message.text.isEmpty { actions.append(.action(ContextMenuActionItem(text: chatPresentationInterfaceState.strings.Conversation_ContextMenuSpeak, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Message"), color: theme.actionSheet.primaryTextColor) }, action: { _, f in diff --git a/submodules/TelegramUI/Sources/ChatSecretAutoremoveTimerActionSheet.swift b/submodules/TelegramUI/Sources/ChatSecretAutoremoveTimerActionSheet.swift index e1380c75c8..96ed01bd06 100644 --- a/submodules/TelegramUI/Sources/ChatSecretAutoremoveTimerActionSheet.swift +++ b/submodules/TelegramUI/Sources/ChatSecretAutoremoveTimerActionSheet.swift @@ -179,7 +179,7 @@ private final class AutoremoveTimeoutSelectorItemNode: ActionSheetItemNode, UIPi self.pickerView.frame = CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: 180.0)) - self.updateInternalLayout(size) + self.updateInternalLayout(size, constrainedSize: constrainedSize) return size } }