mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-15 18:59:54 +00:00
Fix unpinned story indices
This commit is contained in:
parent
d5561c092a
commit
1cee5070f8
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user