Skip to content

Commit e0af1d3

Browse files
fix(mobile): load-more reads the latest load error before retrying
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 9663385 commit e0af1d3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/mobile/src/features/pull-requests/usePullRequestList.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ export function usePullRequestList(targets: readonly ListTarget[]) {
159159
// Read from the registry, not the render: a second onEndReached before React re-renders must
160160
// see the load the first one started.
161161
const loadMore = (retry = false) => {
162-
if (registry.get(pageAtom).waiting || registry.get(refreshAtom).waiting) return;
163-
if (!retry && loadError) return;
162+
const pageResult = registry.get(pageAtom);
163+
const refreshResult = registry.get(refreshAtom);
164+
if (pageResult.waiting || refreshResult.waiting) return;
165+
if (!retry && (settledError(refreshResult) ?? settledError(pageResult))) return;
164166
if (!continuations(registry, targets).length) return;
165167
registry.set(refreshAtom, Atom.Reset);
166168
registry.set(pageAtom, retry);

0 commit comments

Comments
 (0)