about summary refs log tree commit diff
path: root/app/assets/javascripts/components/actions/notifications.jsx
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-26 04:30:40 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-26 04:30:40 +0100
commit905c82917959a5afe24cb85c62c0b0ba13f0da8b (patch)
treea22df9a8737250f97a6024943af3445a163917b3 /app/assets/javascripts/components/actions/notifications.jsx
parent57f7cf834921d49f28f346571e0e6fb596ccd6f8 (diff)
Improve infinite scroll on notifications
Diffstat (limited to 'app/assets/javascripts/components/actions/notifications.jsx')
-rw-r--r--app/assets/javascripts/components/actions/notifications.jsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/actions/notifications.jsx b/app/assets/javascripts/components/actions/notifications.jsx
index 23bdcb5c7..1731c1857 100644
--- a/app/assets/javascripts/components/actions/notifications.jsx
+++ b/app/assets/javascripts/components/actions/notifications.jsx
@@ -96,13 +96,17 @@ export function expandNotifications() {
   return (dispatch, getState) => {
     const url = getState().getIn(['notifications', 'next'], null);
 
-    if (url === null) {
+    if (url === null || getState().getIn(['notifications', 'isLoading'])) {
       return;
     }
 
     dispatch(expandNotificationsRequest());
 
-    api(getState).get(url).then(response => {
+    api(getState).get(url, {
+      params: {
+        limit: 5
+      }
+    }).then(response => {
       const next = getLinks(response).refs.find(link => link.rel === 'next');
 
       dispatch(expandNotificationsSuccess(response.data, next ? next.uri : null));