From 1b45848d1d1b925ab8efb52f82224524af94cca9 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Thu, 19 Nov 2020 14:56:20 +1000 Subject: [PATCH] notifications: fix scroll to load --- pkg/interface/src/views/apps/notifications/inbox.tsx | 7 ++++--- .../src/views/apps/notifications/notifications.tsx | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/interface/src/views/apps/notifications/inbox.tsx b/pkg/interface/src/views/apps/notifications/inbox.tsx index 9f06402cae..cff3acff35 100644 --- a/pkg/interface/src/views/apps/notifications/inbox.tsx +++ b/pkg/interface/src/views/apps/notifications/inbox.tsx @@ -83,7 +83,7 @@ export default function Inbox(props: { const onScroll = useCallback((e) => { let container = e.target; const { scrollHeight, scrollTop, clientHeight } = container; - if((scrollHeight - scrollTop - clientHeight) < 20) { + if((scrollHeight - scrollTop) < 1.5 * clientHeight) { api.hark.getMore(props.showArchive); } }, [props.showArchive]); @@ -129,7 +129,7 @@ export default function Inbox(props: { }; return ( - + {inviteItems(invites, api)} {newNotifications && ( nots.length).reduce(f.add, 0); + if (lent === 0 || timeboxes.length === 0) { return null; } diff --git a/pkg/interface/src/views/apps/notifications/notifications.tsx b/pkg/interface/src/views/apps/notifications/notifications.tsx index 0c7302c3a0..e76b927947 100644 --- a/pkg/interface/src/views/apps/notifications/notifications.tsx +++ b/pkg/interface/src/views/apps/notifications/notifications.tsx @@ -53,7 +53,7 @@ export default function NotificationsScreen(props: any) { const { view } = routeProps.match.params; return ( - +