mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 11:20:18 +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 current = self.focusedId {
|
||||||
if let index = state.items.firstIndex(where: { $0.id == current }) {
|
if let index = state.items.firstIndex(where: { $0.id == current }) {
|
||||||
focusedIndex = index
|
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
|
focusedIndex = index
|
||||||
} else if !state.items.isEmpty {
|
} else if !state.items.isEmpty {
|
||||||
focusedIndex = 0
|
focusedIndex = 0
|
||||||
@ -1179,7 +1179,7 @@ public final class PeerStoryListContentContextImpl: StoryContentContext {
|
|||||||
} else if let initialId = initialId {
|
} else if let initialId = initialId {
|
||||||
if let index = state.items.firstIndex(where: { $0.id == initialId }) {
|
if let index = state.items.firstIndex(where: { $0.id == initialId }) {
|
||||||
focusedIndex = index
|
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
|
focusedIndex = index
|
||||||
} else {
|
} else {
|
||||||
focusedIndex = nil
|
focusedIndex = nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user