about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-12-12 17:00:31 +0100
committerThibG <thib@sitedethib.com>2018-12-13 15:00:36 +0100
commit1e656c36322f4f941b8d432243454c16273d25b6 (patch)
tree86c18dca5b6952adb4f4ff0bf7a517483e9bd450 /app
parent2d097c10d008780c56798c444ae4d18414310bdb (diff)
[Glitch] Fix “load more” button when no data has been fetched
Diffstat (limited to 'app')
-rw-r--r--app/javascript/flavours/glitch/components/status_list.js2
-rw-r--r--app/javascript/flavours/glitch/features/account_gallery/index.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/status_list.js b/app/javascript/flavours/glitch/components/status_list.js
index 68cd608b9..5249af76d 100644
--- a/app/javascript/flavours/glitch/components/status_list.js
+++ b/app/javascript/flavours/glitch/components/status_list.js
@@ -55,7 +55,7 @@ export default class StatusList extends ImmutablePureComponent {
   }
 
   handleLoadOlder = debounce(() => {
-    this.props.onLoadMore(this.props.statusIds.last());
+    this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);
   }, 300, { leading: true })
 
   _selectChild (index) {
diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.js b/app/javascript/flavours/glitch/features/account_gallery/index.js
index a77db1c1b..3f61af0e8 100644
--- a/app/javascript/flavours/glitch/features/account_gallery/index.js
+++ b/app/javascript/flavours/glitch/features/account_gallery/index.js
@@ -67,7 +67,7 @@ export default class AccountGallery extends ImmutablePureComponent {
 
   handleScrollToBottom = () => {
     if (this.props.hasMore) {
-      this.handleLoadMore(this.props.medias.last().getIn(['status', 'id']));
+      this.handleLoadMore(this.props.medias.size > 0 ? this.props.medias.last().getIn(['status', 'id']) : undefined);
     }
   }