diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryChatContent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryChatContent.swift index 6c8ce5fde4..e1e5bbd8f7 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryChatContent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryChatContent.swift @@ -1169,7 +1169,7 @@ public final class PeerStoryListContentContextImpl: StoryContentContext { if let current = self.focusedId { if let index = state.items.firstIndex(where: { $0.id == current }) { focusedIndex = index - } else if let index = state.items.firstIndex(where: { $0.id >= current }) { + } else if let index = state.items.firstIndex(where: { $0.id <= current }) { focusedIndex = index } else if !state.items.isEmpty { focusedIndex = 0 @@ -1179,7 +1179,7 @@ public final class PeerStoryListContentContextImpl: StoryContentContext { } else if let initialId = initialId { if let index = state.items.firstIndex(where: { $0.id == initialId }) { focusedIndex = index - } else if let index = state.items.firstIndex(where: { $0.id >= initialId }) { + } else if let index = state.items.firstIndex(where: { $0.id <= initialId }) { focusedIndex = index } else { focusedIndex = nil