]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix “load more” button when no data has been fetched
authorThibaut Girka <thib@sitedethib.com>
Wed, 12 Dec 2018 16:00:31 +0000 (17:00 +0100)
committerThibG <thib@sitedethib.com>
Thu, 13 Dec 2018 14:00:36 +0000 (15:00 +0100)
app/javascript/flavours/glitch/components/status_list.js
app/javascript/flavours/glitch/features/account_gallery/index.js

index 68cd608b9114d1c9bcd47a4c4fdbbf9f2b05e746..5249af76d58462f8e8866abadf58585f4c73a9f0 100644 (file)
@@ -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) {
index a77db1c1b8526125e786001cec8fb1b92a1a0e2c..3f61af0e84c1ccf29fe7541afc9e04b0a13c1a8e 100644 (file)
@@ -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);
     }
   }