From 6cd7d5ca5bd3dcb892654251e9a5e205399f99cd Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 11 Aug 2018 14:02:37 -0700 Subject: [PATCH] Fixes: Homepage pagination --- app/stores/DocumentsStore.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/stores/DocumentsStore.js b/app/stores/DocumentsStore.js index 2e639ea65..9a8e98934 100644 --- a/app/stores/DocumentsStore.js +++ b/app/stores/DocumentsStore.js @@ -102,7 +102,7 @@ class DocumentsStore extends BaseStore { fetchPage = async ( request: string = 'list', options: ?PaginationParams - ): Promise<*> => { + ): Promise => { this.isFetching = true; try { @@ -128,8 +128,8 @@ class DocumentsStore extends BaseStore { const data = await this.fetchPage('list', options); runInAction('DocumentsStore#fetchRecentlyEdited', () => { - this.recentlyEditedIds = uniq( - map(data, 'id').concat(this.recentlyEditedIds) + this.recentlyEditedIds.replace( + uniq(this.recentlyEditedIds.concat(map(data, 'id'))) ); }); return data; @@ -140,8 +140,8 @@ class DocumentsStore extends BaseStore { const data = await this.fetchPage('viewed', options); runInAction('DocumentsStore#fetchRecentlyViewed', () => { - this.recentlyViewedIds = uniq( - map(data, 'id').concat(this.recentlyViewedIds) + this.recentlyViewedIds.replace( + uniq(this.recentlyViewedIds.concat(map(data, 'id'))) ); }); return data;