From c86ff23757213e7a9af121b341668d382efb8ede Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 28 Nov 2022 10:22:52 -0600 Subject: Set a page-size on notifications --- src/state/models/notifications-view.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts index 09189cfbb..80e5c80c6 100644 --- a/src/state/models/notifications-view.ts +++ b/src/state/models/notifications-view.ts @@ -7,7 +7,7 @@ import {APP_BSKY_GRAPH} from '../../third-party/api' import {cleanError} from '../../lib/strings' const UNGROUPABLE_REASONS = ['trend', 'assertion'] - +const PAGE_SIZE = 30 const MS_60MIN = 1e3 * 60 * 60 export interface GroupedNotification extends ListNotifications.Notification { @@ -242,9 +242,10 @@ export class NotificationsViewModel { private async _initialLoad(isRefreshing = false) { this._xLoading(isRefreshing) try { - const res = await this.rootStore.api.app.bsky.notification.list( - this.params, - ) + const params = Object.assign({}, this.params, { + limit: PAGE_SIZE, + }) + const res = await this.rootStore.api.app.bsky.notification.list(params) this._replaceAll(res) this._xIdle() } catch (e: any) { @@ -259,6 +260,7 @@ export class NotificationsViewModel { this._xLoading() try { const params = Object.assign({}, this.params, { + limit: PAGE_SIZE, before: this.loadMoreCursor, }) const res = await this.rootStore.api.app.bsky.notification.list(params) -- cgit 1.4.1