Skip to content

Commit e3bf469

Browse files
author
Isaac
committed
Stories
1 parent 888b124 commit e3bf469

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreen.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,6 @@ final class ShareWithPeersScreenComponent: Component {
18331833
sectionOffset += footerSize.height
18341834
} else if section.id == 4 && section.itemCount > 0 {
18351835
var sectionItemOffset: CGFloat = 0.0
1836-
//TODO:release
18371836
if self.selectedOptions.contains(.pin) && !"".isEmpty {
18381837
let itemFrame = CGRect(origin: CGPoint(x: itemLayout.sideInset, y: sectionOffset + section.insets.top + sectionItemOffset), size: CGSize(width: itemLayout.containerSize.width, height: section.itemHeight))
18391838
if !visibleBounds.intersects(itemFrame) {
@@ -2732,10 +2731,6 @@ final class ShareWithPeersScreenComponent: Component {
27322731
if hasCover {
27332732
itemCount += 1
27342733
}
2735-
//TODO:release
2736-
/*if self.selectedOptions.contains(.pin) {
2737-
itemCount += 1
2738-
}*/
27392734
if itemCount != 0 {
27402735
sections.append(ItemLayout.Section(
27412736
id: 4,

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,15 @@ private final class StoryContainerScreenComponent: Component {
952952
} else {
953953
let itemViewFrame = currentItemView.convert(currentItemView.bounds, to: self)
954954
if location.x < itemViewFrame.minX {
955-
self.navigate(direction: .previous)
955+
if slice.previousItemId == nil && currentItemView.preventTapNavigation() {
956+
} else {
957+
self.navigate(direction: .previous)
958+
}
956959
} else if location.x > itemViewFrame.maxX {
957-
self.navigate(direction: .next)
960+
if slice.nextItemId == nil && currentItemView.preventTapNavigation() {
961+
} else {
962+
self.navigate(direction: .next)
963+
}
958964
}
959965
}
960966
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,16 @@ public final class StoryItemSetContainerComponent: Component {
945945
return false
946946
}
947947

948+
func preventTapNavigation() -> Bool {
949+
guard let component = self.component else {
950+
return false
951+
}
952+
if case .liveStream = component.slice.item.storyItem.media {
953+
return true
954+
}
955+
return false
956+
}
957+
948958
func deactivateInput() {
949959
if let view = self.inputPanel.view as? MessageInputPanelComponent.View, view.canDeactivateInput() {
950960
self.sendMessageContext.currentInputMode = .text
@@ -3234,7 +3244,7 @@ public final class StoryItemSetContainerComponent: Component {
32343244
}
32353245
self.sendMessageContext.performShareAction(view: self)
32363246
} : nil,
3237-
paidMessageAction: isLiveStream && !component.isEmbeddedInCamera ? { [weak self] in
3247+
paidMessageAction: isLiveStream && component.slice.item.peerId != component.context.account.peerId && !component.isEmbeddedInCamera ? { [weak self] in
32383248
guard let self else {
32393249
return
32403250
}
@@ -4269,7 +4279,7 @@ public final class StoryItemSetContainerComponent: Component {
42694279
closeFriendIcon.view?.removeFromSuperview()
42704280
}
42714281

4272-
if case .liveStream = component.slice.item.storyItem.media {
4282+
if case .liveStream = component.slice.item.storyItem.media, !component.isEmbeddedInCamera {
42734283
let pictureInPictureIcon: ComponentView<Empty>
42744284
var pictureInPictureIconTransition: ComponentTransition = itemChanged ? .immediate : .easeInOut(duration: 0.2)
42754285
if let current = self.pictureInPictureIcon {

0 commit comments

Comments
 (0)