Skip to content

Commit 63055d7

Browse files
author
Isaac
committed
Merge branch 'beta'
2 parents 38eaa90 + a8f0923 commit 63055d7

File tree

5 files changed

+59
-3
lines changed

5 files changed

+59
-3
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15427,3 +15427,6 @@ Error: %8$@";
1542715427

1542815428
"Gift.Options.Gift.JoinAuction" = "Join";
1542915429
"Gift.Options.Gift.ViewAuction" = "View";
15430+
15431+
"LiveStream.ErrorMaxAllowedEmoji.Text_1" = "You can send up to %d emoji.";
15432+
"LiveStream.ErrorMaxAllowedEmoji.Text_any" = "You can send up to %d emoji.";

submodules/TelegramUI/Components/AsyncListComponent/Sources/AsyncListComponent.swift

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,34 @@ public final class AsyncListComponent: Component {
165165
return nil
166166
}
167167
}
168+
169+
public final class VisibleItemViews: Sequence, IteratorProtocol {
170+
private var index: Int = 0
171+
private let itemViews: [UIView]
172+
173+
init(view: AsyncListComponent.View) {
174+
var itemViews: [(Int, UIView)] = []
175+
view.listNode.forEachItemNode { itemNode in
176+
if let itemNode = itemNode as? ListItemNodeImpl, let index = itemNode.index {
177+
if let itemContentView = itemNode.contentsView.view {
178+
itemViews.append((index, itemContentView))
179+
}
180+
}
181+
}
182+
itemViews.sort(by: { $0.0 < $1.0 })
183+
self.itemViews = itemViews.map(\.1)
184+
}
185+
186+
public func next() -> UIView? {
187+
if self.index >= self.itemViews.count {
188+
return nil
189+
}
190+
let index = self.index
191+
self.index += 1
192+
193+
return self.itemViews[index]
194+
}
195+
}
168196

169197
public let externalState: ExternalState
170198
public let externalStateValue: ExternalState.Value
@@ -505,6 +533,10 @@ public final class AsyncListComponent: Component {
505533
return nil
506534
}
507535

536+
public func visibleItemViews() -> VisibleItemViews {
537+
return VisibleItemViews(view: self)
538+
}
539+
508540
func update(component: AsyncListComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: ComponentTransition) -> CGSize {
509541
let previousComponent = self.component
510542
self.component = component

submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContentLiveChatComponent.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ final class StoryContentLiveChatComponent: Component {
752752
containerSize: availableSize
753753
)
754754
let listFrame = CGRect(origin: CGPoint(), size: availableSize)
755-
if let listView = self.list.view {
755+
if let listView = self.list.view as? AsyncListComponent.View {
756756
if listView.superview == nil {
757757
listView.transform = CGAffineTransformMakeRotation(CGFloat.pi)
758758
self.listContainer.addSubview(listView)
@@ -766,7 +766,20 @@ final class StoryContentLiveChatComponent: Component {
766766
} else {
767767
listAlpha = listItems.isEmpty ? 0.0 : 1.0
768768
}
769-
alphaTransition.setAlpha(view: listView, alpha: listAlpha)
769+
if previousListIsEmpty && !listItems.isEmpty && !alphaTransition.animation.isImmediate {
770+
listView.alpha = 1.0
771+
var delay: Double = 0.0
772+
let delayIncrement: Double = 0.014
773+
for itemView in listView.visibleItemViews() {
774+
if let itemView = itemView as? StoryLiveChatMessageComponent.View {
775+
itemView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, delay: delay)
776+
itemView.layer.animateScale(from: 0.95, to: 1.0, duration: 0.2, delay: delay)
777+
delay += delayIncrement
778+
}
779+
}
780+
} else {
781+
alphaTransition.setAlpha(view: listView, alpha: listAlpha)
782+
}
770783
}
771784

772785
transition.setFrame(view: self.listContainer, frame: CGRect(origin: CGPoint(), size: availableSize))

submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,14 @@ final class StoryItemSetContainerSendMessage: @unchecked(Sendable) {
751751
}
752752
}
753753
if emojiCount > maxEmojiCount {
754+
let absMaxEmojiCount = paramSets.paramSets.max(by: { $0.minStars < $1.minStars })?.maxEmojiCount ?? 10
755+
if emojiCount > absMaxEmojiCount {
756+
let presentationData = component.context.sharedContext.currentPresentationData.with({ $0 }).withUpdated(theme: component.theme)
757+
view.component?.controller()?.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: presentationData.strings.LiveStream_ErrorMaxAllowedEmoji_Text(Int32(absMaxEmojiCount)), actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), in: .window(.root))
758+
759+
return
760+
}
761+
754762
sendDisabledMinStars = paramSets.paramSets.sorted(by: { $0.minStars < $1.minStars }).first(where: { $0.maxEmojiCount >= emojiCount })?.minStars ?? 1000000000
755763
}
756764
}

versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "12.2",
2+
"app": "12.2.1",
33
"xcode": "26.0",
44
"bazel": "8.3.1:0cac3a67dc5429c68272dc6944104952e9e4cf84b29d126a5ff3fbaa59045217",
55
"macos": "26"

0 commit comments

Comments
 (0)