Skip to content

Fix/settlements panel reentrancy#346

Open
chuks68 wants to merge 2 commits into
AnchorNet-Org:mainfrom
chuks68:fix/settlements-panel-reentrancy
Open

Fix/settlements panel reentrancy#346
chuks68 wants to merge 2 commits into
AnchorNet-Org:mainfrom
chuks68:fix/settlements-panel-reentrancy

Conversation

@chuks68

@chuks68 chuks68 commented Jul 21, 2026

Copy link
Copy Markdown

Closes #142
Summary
This PR resolves a re-entrancy bug in the SettlementsPanel component (SettlementsPanel.tsx).

The Problem

The loadMore function in SettlementsPanel previously only checked if state.status !== "ready" before fetching more settlements. Although the "Load more" button is disabled during loading (disabled={loadingMore}), other trigger paths (such as keyboard shortcuts or rapid Enter presses) could call loadMore concurrently before React updated the disabled state. This resulted in duplicate concurrent fetches.

The Solution

Added an early return guard:

if (loadingMore) return;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guard SettlementsPanel's loadMore against re-entrant calls while a page is already loading

1 participant