Skip to content

Add error state handling and retry functionality to rewards page#2101

Merged
MusabShakeel576 merged 1 commit into
qafrom
claude/confident-pasteur-Q5XJG
May 28, 2026
Merged

Add error state handling and retry functionality to rewards page#2101
MusabShakeel576 merged 1 commit into
qafrom
claude/confident-pasteur-Q5XJG

Conversation

@MusabShakeel576
Copy link
Copy Markdown
Contributor

Summary

Enhanced the rewards page with proper error state handling and a retry mechanism. Users can now see a user-friendly error message with a "Try Again" button when rewards data fails to load, instead of the page silently failing.

Key Changes

  • Error UI: Added error state display in the rewards page that shows when data fails to load, with a retry button powered by the RotateCw icon from lucide-react-native
  • Query refetch: Exposed the refetch function from useRewardsUserData hook to enable manual retry of failed requests
  • Removed unnecessary enabled checks: Removed enabled: !!getJWTToken() conditions from three query hooks (useRewardsUserData, useTierBenefits, useRewardsConfig) as token validation is already handled by the withRefreshToken wrapper
  • Removed unused import: Cleaned up the unused getJWTToken import from the hooks file

Implementation Details

  • The error state is only displayed when isError is true and isLoading is false, preventing the error UI from showing during initial load attempts
  • The retry button calls refetch() to re-execute the failed query
  • Error handling now provides better UX by giving users explicit feedback and control over retrying failed requests

https://claude.ai/code/session_01SREGQCDTiC5CNZRJkjVFj3

…or fallback

useRewardsUserData/useTierBenefits/useRewardsConfig used enabled: !!getJWTToken(),
but getJWTToken returns null on web, so the queries never ran and the rewards
page hung in <PageLayout isLoading /> forever. Web auth rides on cookies via
credentials: 'include'; mobile is already inside (protected). Also surface a
retry UI when the data fetch errors instead of silently spinning.

https://claude.ai/code/session_01SREGQCDTiC5CNZRJkjVFj3
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored May 28, 2026 8:03am
solid-app-staging Ignored Ignored May 28, 2026 8:03am

Request Review

@MusabShakeel576 MusabShakeel576 merged commit 6d4c5e1 into qa May 28, 2026
4 of 5 checks passed
@MusabShakeel576 MusabShakeel576 deleted the claude/confident-pasteur-Q5XJG branch May 28, 2026 08:08
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.

2 participants