aboutsummaryrefslogtreecommitdiff
path: root/src/components/notifications
diff options
context:
space:
mode:
authorshpuld <shp@cock.li>2019-01-30 20:49:24 +0200
committershpuld <shp@cock.li>2019-01-30 20:49:24 +0200
commitc7cffbb6c70bbb21cf787d96e82e0261427b9234 (patch)
treea517e4942725286b173b685cbe87bc6c7878b66e /src/components/notifications
parent51024a2c8af9d88b07c050b7502fa62843aa4ba2 (diff)
parentb1facdf7ad54436c2afde7c28c917cda87a5b7e3 (diff)
Merge branch 'develop' into feat/media-modal
Diffstat (limited to 'src/components/notifications')
-rw-r--r--src/components/notifications/notifications.js14
-rw-r--r--src/components/notifications/notifications.vue9
2 files changed, 21 insertions, 2 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
+ }
})
}
}
diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue
index 64f18720..6f162b62 100644
--- a/src/components/notifications/notifications.vue
+++ b/src/components/notifications/notifications.vue
@@ -18,10 +18,15 @@
</div>
</div>
<div class="panel-footer">
- <a href="#" v-on:click.prevent='fetchOlderNotifications()' v-if="!notifications.loading">
+ <div v-if="bottomedOut" class="new-status-notification text-center panel-footer faint">
+ {{$t('notifications.no_more_notifications')}}
+ </div>
+ <a v-else-if="!loading" href="#" v-on:click.prevent="fetchOlderNotifications()">
<div class="new-status-notification text-center panel-footer">{{$t('notifications.load_older')}}</div>
</a>
- <div class="new-status-notification text-center panel-footer" v-else>...</div>
+ <div v-else class="new-status-notification text-center panel-footer">
+ <i class="icon-spin3 animate-spin"/>
+ </div>
</div>
</div>
</div>