Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Mobile app scroll does not load new items when installed #377

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/frontend/src/mobile-components/Superfeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { twMerge, ModuleLoader } from "@alphaday/ui-kit";
import { IonFab, IonList } from "@ionic/react";
import { useOnScreen } from "src/api/hooks";
import { TSuperfeedItem } from "src/api/types";
import { isPWA } from "src/api/utils/helpers";
import { shouldFetchMoreItems } from "src/api/utils/itemUtils";
import { ReactComponent as SettingsSVG } from "src/assets/icons/settings.svg";
import { ReactComponent as Settings2SVG } from "src/assets/icons/settings3.svg";
Expand Down Expand Up @@ -38,6 +37,7 @@ const SuperfeedModule: FC<ISuperfeedModule> = ({
}) => {
const filtersWrap: React.Ref<HTMLDivElement> = useRef(null);
const isFiltersVisible = useOnScreen(filtersWrap);

const handleScrollEvent = useCallback(
({ currentTarget }: FormEvent<HTMLElement>) => {
if (shouldFetchMoreItems(currentTarget)) {
elcharitas marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -55,10 +55,7 @@ const SuperfeedModule: FC<ISuperfeedModule> = ({
<>
<IonList
onScroll={handleScrollEvent}
onScrollCapture={handleScrollEvent}
className={`w-full px-3.5 pt-4 bg-transparent ${
isPWA() ? "" : "overflow-y-auto overscroll-contain h-full"
}`}
className="w-full px-3.5 pt-4 bg-transparent overflow-y-auto overscroll-contain h-full"
>
<div
ref={filtersWrap}
Expand Down
Loading