From 1e656c36322f4f941b8d432243454c16273d25b6 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Wed, 12 Dec 2018 17:00:31 +0100 Subject: [PATCH] =?UTF-8?q?[Glitch]=20Fix=20=E2=80=9Cload=20more=E2=80=9D?= =?UTF-8?q?=20button=20when=20no=20data=20has=20been=20fetched?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/flavours/glitch/components/status_list.js | 2 +- .../flavours/glitch/features/account_gallery/index.js | 2 +- 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 68cd608b91..5249af76d5 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 a77db1c1b8..3f61af0e84 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); } }