diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-07-12 20:50:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-12 20:50:04 +0300 |
commit | ff57e75b12cef3fc53e9439e3f9cd308e0312cc4 (patch) | |
tree | 3ce8c33899d420f9ef7ac7ca435bc96d836b56c0 /src/view | |
parent | 0e3124a97e96d7f897a7125374b63a98d053598a (diff) | |
download | voidsky-ff57e75b12cef3fc53e9439e3f9cd308e0312cc4.tar.zst |
fix mention tab flicker (#8640)
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/com/notifications/NotificationFeed.tsx | 8 | ||||
-rw-r--r-- | src/view/com/util/PostMeta.tsx | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/view/com/notifications/NotificationFeed.tsx b/src/view/com/notifications/NotificationFeed.tsx index bad09929a..ca4ba9814 100644 --- a/src/view/com/notifications/NotificationFeed.tsx +++ b/src/view/com/notifications/NotificationFeed.tsx @@ -59,7 +59,13 @@ export function NotificationFeed({ enabled: enabled && !!moderationOpts, filter, }) - const isEmpty = !isFetching && !data?.pages[0]?.items.length + // previously, this was `!isFetching && !data?.pages[0]?.items.length` + // however, if the first page had no items (can happen in the mentions tab!) + // it would flicker the empty state whenever it was loading. + // therefore, we need to find if *any* page has items. in 99.9% of cases, + // the `.find()` won't need to go any further than the first page -sfn + const isEmpty = + !isFetching && !data?.pages.find(page => page.items.length > 0) const items = React.useMemo(() => { let arr: any[] = [] diff --git a/src/view/com/util/PostMeta.tsx b/src/view/com/util/PostMeta.tsx index c1f804203..c0feea5d4 100644 --- a/src/view/com/util/PostMeta.tsx +++ b/src/view/com/util/PostMeta.tsx @@ -122,6 +122,7 @@ let PostMeta = (opts: PostMetaOpts): React.ReactNode => { </View> )} <WebOnlyInlineLinkText + emoji numberOfLines={1} to={profileLink} label={_(msg`View profile`)} |