mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge pull request #428 from RyanRory/last-image-lost
Fix Image Gallery Count Bug
This commit is contained in:
commit
6c293a3b5a
|
@ -630,7 +630,7 @@ class MediaGallery: NSObject, MediaGalleryDataSource, MediaTileViewControllerDel
|
|||
// To keep it simple, this isn't exactly *amount* sized if `message` window overlaps the end or
|
||||
// beginning of the view. Still, we have sufficient buffer to fetch more as the user swipes.
|
||||
let start: Int = initialIndex - Int(amount) / 2
|
||||
let end: Int = initialIndex + Int(amount) / 2
|
||||
let end: Int = initialIndex + Int(amount) / 2 + 1
|
||||
|
||||
return start..<end
|
||||
case .before:
|
||||
|
@ -640,7 +640,7 @@ class MediaGallery: NSObject, MediaGalleryDataSource, MediaTileViewControllerDel
|
|||
return start..<end
|
||||
case .after:
|
||||
let start: Int = initialIndex
|
||||
let end: Int = initialIndex + Int(amount)
|
||||
let end: Int = initialIndex + Int(amount) + 1
|
||||
|
||||
return start..<end
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue