notifications: fix scroll to load

This commit is contained in:
Liam Fitzgerald 2020-11-19 14:56:20 +10:00
parent 90faac16c9
commit 1b45848d1d
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
2 changed files with 5 additions and 4 deletions

View File

@ -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 (
<Col onScroll={onScroll} overflowY="auto" flexGrow={1} minHeight='0' flexShrink={0}>
<Col height="100%" overflowY="auto" onScroll={onScroll} >
{inviteItems(invites, api)}
{newNotifications && (
<DaySection
@ -197,7 +197,8 @@ function DaySection({
const calendar = latest
? MOMENT_CALENDAR_DATE
: { ...MOMENT_CALENDAR_DATE, sameDay: "[Earlier Today]" };
if (timeboxes.length === 0) {
const lent = timeboxes.map(([,nots]) => nots.length).reduce(f.add, 0);
if (lent === 0 || timeboxes.length === 0) {
return null;
}

View File

@ -53,7 +53,7 @@ export default function NotificationsScreen(props: any) {
const { view } = routeProps.match.params;
return (
<Body>
<Col height="100%" minHeight='0' overflowY='scroll'>
<Col overflowY="hidden" height="100%">
<Row
p="3"
alignItems="center"