diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/StoryListContext.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/StoryListContext.swift index 370a7f698c..70b0b01e1f 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/StoryListContext.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/StoryListContext.swift @@ -839,6 +839,9 @@ public final class PeerExpiringStoryListContext { private var pollDisposable: Disposable? private let statePromise = Promise() + var state: Signal { + return self.statePromise.get() + } init(queue: Queue, account: Account, peerId: EnginePeer.Id) { self.queue = queue @@ -1034,6 +1037,12 @@ public final class PeerExpiringStoryListContext { private let queue: Queue private let impl: QueueLocalObject + public var state: Signal { + return impl.signalWith { impl, subscriber in + return impl.state.start(next: subscriber.putNext) + } + } + public init(account: Account, peerId: EnginePeer.Id) { let queue = Queue.mainQueue() self.queue = queue diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift index 92e11ea18c..8fcfea487d 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift @@ -472,6 +472,19 @@ public final class StoryItemSetContainerComponent: Component { return super.hitTest(point, with: event) } + private func isProgressPaused() -> Bool { + guard let component = self.component else { + return false + } + if self.inputPanelExternalState.isEditing || component.isProgressPaused || self.displayReactions || self.actionSheet != nil || self.contextController != nil || self.sendMessageContext.audioRecorderValue != nil || self.sendMessageContext.videoRecorderValue != nil || self.displayViewList { + return true + } + if let captionItem = self.captionItem, captionItem.externalState.expandFraction > 0.0 { + return true + } + return false + } + private func updateScrolling(transition: Transition) { guard let component = self.component, let itemLayout = self.itemLayout else { return @@ -535,7 +548,7 @@ public final class StoryItemSetContainerComponent: Component { itemTransition.setFrame(view: view, frame: CGRect(origin: CGPoint(), size: itemLayout.size)) if let view = view as? StoryContentItem.View { - view.setIsProgressPaused(self.inputPanelExternalState.isEditing || component.isProgressPaused || self.displayReactions || self.actionSheet != nil || self.contextController != nil || self.sendMessageContext.audioRecorderValue != nil || self.sendMessageContext.videoRecorderValue != nil || self.displayViewList) + view.setIsProgressPaused(self.isProgressPaused()) } } @@ -554,13 +567,10 @@ public final class StoryItemSetContainerComponent: Component { } func updateIsProgressPaused() { - guard let component = self.component else { - return - } for (_, visibleItem) in self.visibleItems { if let view = visibleItem.view.view { if let view = view as? StoryContentItem.View { - view.setIsProgressPaused(self.inputPanelExternalState.isEditing || component.isProgressPaused || self.displayReactions || self.actionSheet != nil || self.contextController != nil || self.sendMessageContext.audioRecorderValue != nil || self.sendMessageContext.videoRecorderValue != nil || self.displayViewList || self.isEditingStory) + view.setIsProgressPaused(self.isProgressPaused()) } } } diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift index 0808bd8d2d..c7a02057d3 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift @@ -401,9 +401,11 @@ func keepPeerInfoScreenDataHot(context: AccountContext, peerId: PeerId, chatLoca if case .user = inputData { signals.append(Signal { _ in let listContext = PeerStoryListContext(account: context.account, peerId: peerId, isArchived: false) + let expiringListContext = PeerExpiringStoryListContext(account: context.account, peerId: peerId) return ActionDisposable { let _ = listContext + let _ = expiringListContext } }) }