From e9102bcbac1a720060456436bee524171a1d66f1 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 16 Nov 2022 13:18:53 -0600 Subject: [PATCH] Reduce jank in refreshes --- src/state/models/feed-view.ts | 3 +++ src/state/models/notifications-view.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts index e89a5419..67a927a7 100644 --- a/src/state/models/feed-view.ts +++ b/src/state/models/feed-view.ts @@ -194,6 +194,9 @@ export class FeedModel { * Load for first render */ async setup(isRefreshing = false) { + if (isRefreshing) { + this.isRefreshing = true // set optimistically for UI + } if (this._loadPromise) { return this._loadPromise } diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts index 3a91eb32..c328be62 100644 --- a/src/state/models/notifications-view.ts +++ b/src/state/models/notifications-view.ts @@ -160,6 +160,9 @@ export class NotificationsViewModel { * Load for first render */ async setup(isRefreshing = false) { + if (isRefreshing) { + this.isRefreshing = true // set optimistically for UI + } if (this._loadPromise) { return this._loadPromise }