Skip to content

Commit 0995e5e

Browse files
author
Isaac
committed
Stories
1 parent 22ba190 commit 0995e5e

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

submodules/ChatListUI/Sources/Node/ChatListItem.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4125,6 +4125,17 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode {
41254125
let liveBadgeFrame = CGRect(origin: CGPoint(x: floor((avatarFrame.width - iconImage.size.width) * 0.5), y: avatarFrame.height + 5.0 - iconImage.size.height), size: iconImage.size)
41264126
transition.updateFrame(view: avatarLiveBadge.foreground, frame: liveBadgeFrame)
41274127
transition.updateFrame(view: avatarLiveBadge.outline, frame: liveBadgeFrame.insetBy(dx: -outlineInset, dy: -outlineInset))
4128+
4129+
let effectiveBackgroundColor: UIColor
4130+
if item.isPinned {
4131+
effectiveBackgroundColor = item.presentationData.theme.chatList.pinnedItemBackgroundColor
4132+
} else {
4133+
effectiveBackgroundColor = item.presentationData.theme.chatList.itemBackgroundColor
4134+
}
4135+
4136+
let highlightAlpha = strongSelf.highlightedBackgroundNode.supernode == nil ? 0.0 : strongSelf.highlightedBackgroundNode.alpha
4137+
let outlineColor = item.presentationData.theme.chatList.itemHighlightedBackgroundColor.mixedWith(effectiveBackgroundColor, alpha: 1.0 - highlightAlpha)
4138+
transition.updateTintColor(view: avatarLiveBadge.outline, color: outlineColor)
41284139
}
41294140

41304141
let onlineInlineNavigationFraction: CGFloat = item.interaction.inlineNavigationLocation?.progress ?? 0.0

submodules/TelegramUI/Components/Stories/LiveChat/StoryLiveChatMessageComponent/Sources/StoryLiveChatMessageComponent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public final class StoryLiveChatMessageComponent: Component {
535535

536536
if let paidStars = component.message.paidStars, let baseColor = GroupCallMessagesContext.getStarAmountParamMapping(params: LiveChatMessageParams(appConfig: component.context.currentAppConfiguration.with({ $0 })), value: paidStars).color {
537537
backgroundView.tintColor = StoryLiveChatMessageComponent.getMessageColor(color: baseColor)
538-
backgroundView.alpha = component.layout.transparentBackground ? 0.7 : 1.0
538+
backgroundView.alpha = component.layout.transparentBackground ? 0.5 : 1.0
539539
} else {
540540
backgroundView.tintColor = UIColor(white: 0.0, alpha: 0.3)
541541
backgroundView.alpha = 1.0

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ public final class StoryContentContextImpl: StoryContentContext {
589589
private var focusedItem: (peerId: EnginePeer.Id, storyId: Int32?)?
590590

591591
private var currentState: StateContext?
592+
private var stateIsEmpty: Bool = false
592593
private var currentStateUpdatedDisposable: Disposable?
593594

594595
private var pendingState: StateContext?
@@ -645,7 +646,7 @@ public final class StoryContentContextImpl: StoryContentContext {
645646

646647
let storySubscriptions = EngineStorySubscriptions(
647648
accountItem: nil,
648-
items: [EngineStorySubscriptions.Item(
649+
items: state.items.isEmpty ? [] : [EngineStorySubscriptions.Item(
649650
peer: peer,
650651
hasUnseen: state.hasUnseen,
651652
hasUnseenCloseFriends: state.hasUnseenCloseFriends,
@@ -938,6 +939,9 @@ public final class StoryContentContextImpl: StoryContentContext {
938939
self.updateState()
939940
})
940941
})
942+
} else {
943+
self.stateIsEmpty = true
944+
self.updateState()
941945
}
942946
}
943947
} else {
@@ -947,6 +951,12 @@ public final class StoryContentContextImpl: StoryContentContext {
947951

948952
private func updateState() {
949953
guard let currentState = self.currentState else {
954+
if self.stateIsEmpty {
955+
self.stateValue = nil
956+
self.statePromise.set(.single(StoryContentContextState(slice: nil, previousSlice: nil, nextSlice: nil)))
957+
958+
self.updatedPromise.set(.single(Void()))
959+
}
950960
return
951961
}
952962
let stateValue = StoryContentContextState(

0 commit comments

Comments
 (0)