From e636f3bca3a1a59634d01f394ccf647e02f09b5a Mon Sep 17 00:00:00 2001
From: Dessalines <tyhou13@gmx.com>
Date: Wed, 15 Jan 2020 16:20:54 -0500
Subject: Adding limits to inbox fetching. Fixes #420

---
 ui/src/components/navbar.tsx | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

(limited to 'ui/src/components/navbar.tsx')

diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx
index f1c35b1f..9fa1e3dc 100644
--- a/ui/src/components/navbar.tsx
+++ b/ui/src/components/navbar.tsx
@@ -13,7 +13,12 @@ import {
   GetSiteResponse,
   Comment,
 } from '../interfaces';
-import { msgOp, pictshareAvatarThumbnail, showAvatars } from '../utils';
+import {
+  msgOp,
+  pictshareAvatarThumbnail,
+  showAvatars,
+  fetchLimit,
+} from '../utils';
 import { version } from '../version';
 import { i18n } from '../i18next';
 import { T } from 'inferno-i18next';
@@ -56,14 +61,7 @@ export class Navbar extends Component<any, NavbarState> {
     });
 
     this.wsSub = WebSocketService.Instance.subject
-      .pipe(
-        retryWhen(errors =>
-          errors.pipe(
-            delay(3000),
-            take(10)
-          )
-        )
-      )
+      .pipe(retryWhen(errors => errors.pipe(delay(3000), take(10))))
       .subscribe(
         msg => this.parseMessage(msg),
         err => console.error(err),
@@ -241,14 +239,14 @@ export class Navbar extends Component<any, NavbarState> {
         sort: SortType[SortType.New],
         unread_only: true,
         page: 1,
-        limit: 9999,
+        limit: fetchLimit,
       };
 
       let userMentionsForm: GetUserMentionsForm = {
         sort: SortType[SortType.New],
         unread_only: true,
         page: 1,
-        limit: 9999,
+        limit: fetchLimit,
       };
       if (this.currentLocation !== '/inbox') {
         WebSocketService.Instance.getReplies(repliesForm);
-- 
cgit v1.2.3

