Skip to content

[FIX] Enable auto-refresh with polling and manual refresh for admin orders page#288

Open
Siddh2024 wants to merge 1 commit into
rdodiya:gssoc_developfrom
Siddh2024:fix/285-orders-auto-refresh
Open

[FIX] Enable auto-refresh with polling and manual refresh for admin orders page#288
Siddh2024 wants to merge 1 commit into
rdodiya:gssoc_developfrom
Siddh2024:fix/285-orders-auto-refresh

Conversation

@Siddh2024

Copy link
Copy Markdown
Contributor

Description

Enabled auto-refresh for the admin orders page so new orders appear automatically without manual page refresh.

Changes Made

  • Enabled the previously commented-out 30-second polling interval in useEffect
  • Added lastRefreshed timestamp state that displays when data was last fetched
  • Added "Last updated" indicator showing the time of last refresh
  • Added a "Refresh" button for on-demand manual refresh
  • Added Clock icon import from lucide-react
  • Removed unused useRef import

Testing

  1. Navigate to Admin Orders
  2. Orders load normally with skeleton loading state
  3. A "Last updated" timestamp appears after the first fetch
  4. Click "Refresh" button refreshes with spinner
  5. Wait 30 seconds auto-refresh fires with indicator

Fixes #285

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.

[ENHANCEMENT] Admin orders page lacks auto-refresh

1 participant