-
Notifications
You must be signed in to change notification settings - Fork 87
Replace window.reload with proper state refresh after funding #524
Copy link
Copy link
Open
Labels
Milestone
Description
Problem
After a successful pledge in `funding-modal.tsx`, the page does `window.location.reload()` to reflect the new funding state. This breaks the SPA experience, loses scroll position, and causes a jarring full-page refresh.
Current Code
// After successful pledge
window.location.reload();Expected Behavior
- Use React state management to refresh funding data after pledge
- Invalidate relevant queries (e.g., campaign data, funding progress, backers list)
- Show updated funding progress bar immediately
- Maintain scroll position and UI state
- Consider optimistic update: show new amount immediately, reconcile with server
Implementation
- If using React Query / SWR: invalidate campaign and contributions queries
- If using local state: re-fetch via `getCampaignOnChain()` and update sidebar
- Add `onSuccess` callback prop to `FundingModal` to notify parent
Acceptance Criteria
- No full page reload after pledge
- Funding progress updates immediately
- Backers list refreshes
- Scroll position maintained
Priority
Low — Functional but poor UX.
Labels
crowdfunding, ui, ux
Reactions are currently unavailable