summaryrefslogtreecommitdiffstats
path: root/ui/src/components/navbar.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-15 16:20:54 -0500
committerDessalines <tyhou13@gmx.com>2020-01-15 16:20:54 -0500
commite636f3bca3a1a59634d01f394ccf647e02f09b5a (patch)
treea0f5d31f7cf8fca1f37b5c9b3bb2aa83ee6815f6 /ui/src/components/navbar.tsx
parent02344635dbbbb61eb300558295f6de9921b545e2 (diff)
Adding limits to inbox fetching. Fixes #420
Diffstat (limited to 'ui/src/components/navbar.tsx')
-rw-r--r--ui/src/components/navbar.tsx20
1 files changed, 9 insertions, 11 deletions
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);