summaryrefslogtreecommitdiffstats
path: root/ui/src/components/inbox.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/inbox.tsx
parent02344635dbbbb61eb300558295f6de9921b545e2 (diff)
Adding limits to inbox fetching. Fixes #420
Diffstat (limited to 'ui/src/components/inbox.tsx')
-rw-r--r--ui/src/components/inbox.tsx15
1 files changed, 4 insertions, 11 deletions
diff --git a/ui/src/components/inbox.tsx b/ui/src/components/inbox.tsx
index 39109a5d..a302b834 100644
--- a/ui/src/components/inbox.tsx
+++ b/ui/src/components/inbox.tsx
@@ -14,7 +14,7 @@ import {
CommentResponse,
} from '../interfaces';
import { WebSocketService, UserService } from '../services';
-import { msgOp } from '../utils';
+import { msgOp, fetchLimit } from '../utils';
import { CommentNodes } from './comment-nodes';
import { SortSelect } from './sort-select';
import { i18n } from '../i18next';
@@ -58,14 +58,7 @@ export class Inbox extends Component<any, InboxState> {
this.handleSortChange = this.handleSortChange.bind(this);
this.subscription = 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),
@@ -279,7 +272,7 @@ export class Inbox extends Component<any, InboxState> {
sort: SortType[this.state.sort],
unread_only: this.state.unreadOrAll == UnreadOrAll.Unread,
page: this.state.page,
- limit: 9999,
+ limit: fetchLimit,
};
WebSocketService.Instance.getReplies(repliesForm);
@@ -287,7 +280,7 @@ export class Inbox extends Component<any, InboxState> {
sort: SortType[this.state.sort],
unread_only: this.state.unreadOrAll == UnreadOrAll.Unread,
page: this.state.page,
- limit: 9999,
+ limit: fetchLimit,
};
WebSocketService.Instance.getUserMentions(userMentionsForm);
}