diff options
| author | lambda <pleromagit@rogerbraun.net> | 2019-01-30 17:49:27 +0000 |
|---|---|---|
| committer | lambda <pleromagit@rogerbraun.net> | 2019-01-30 17:49:27 +0000 |
| commit | 1717e700469cb6331e2905c7af0d384cf78a1188 (patch) | |
| tree | 8bb0b6f4fa6c8b81c697abc3fb707e4750f66004 /src/components/notifications/notifications.js | |
| parent | 0bd77149a06bcd7e0a904d0f5c2e2691996ff898 (diff) | |
| parent | 7666d50d8a9eb2ef8b5a61a1689b7358ae7d93ea (diff) | |
Merge branch 'feat/dont-show-load-more-when-bottomed-out' into 'develop'
fix #292 dont show "load more" when bottomed out
Closes #292
See merge request pleroma/pleroma-fe!496
Diffstat (limited to 'src/components/notifications/notifications.js')
| -rw-r--r-- | src/components/notifications/notifications.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index ea32bbd0..5e95631a 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -13,6 +13,11 @@ const Notifications = { notificationsFetcher.startFetching({ store, credentials }) }, + data () { + return { + bottomedOut: false + } + }, computed: { notifications () { return notificationsFromStore(this.$store) @@ -28,6 +33,9 @@ const Notifications = { }, unseenCount () { return this.unseenNotifications.length + }, + loading () { + return this.$store.state.statuses.notifications.loading } }, components: { @@ -49,10 +57,16 @@ const Notifications = { fetchOlderNotifications () { const store = this.$store const credentials = store.state.users.currentUser.credentials + store.commit('setNotificationsLoading', { value: true }) notificationsFetcher.fetchAndUpdate({ store, credentials, older: true + }).then(notifs => { + store.commit('setNotificationsLoading', { value: false }) + if (notifs.length === 0) { + this.bottomedOut = true + } }) } } |
