Skip to content

Commit

Permalink
fix(rn): stream pagination
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Jul 3, 2019
1 parent 1248fc6 commit 15e69f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/react-native/app/container/stream.js
Expand Up @@ -121,7 +121,7 @@ export class StreamPagination extends Stream {
let infTop = this.compareInf(cursor, this.cursorExtractor(itemTop))
if (infTop) {
// if item exist, update his position
if (index !== -1) {
if (index !== -1 && index >= topIndex) {
this.queue.splice(
// remove all items from top
topIndex,
Expand All @@ -142,7 +142,7 @@ export class StreamPagination extends Stream {
let supBottom = this.compareSup(cursor, this.cursorExtractor(itemBottom))
if (supBottom) {
// if item exist, update his position
if (index !== -1) {
if (index !== -1 && index < bottomIndex) {
this.queue.splice(
// remove all items from index
index,
Expand Down

0 comments on commit 15e69f1

Please sign in to comment.