mirror of
https://github.com/urbit/shrub.git
synced 2024-11-24 13:06:09 +03:00
notifications: fix scroll to load
This commit is contained in:
parent
90faac16c9
commit
1b45848d1d
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user