Skip to content

fix: reorganize data loading and auto-refresh logic in SiteDashboardP…#25

Merged
uz1mani merged 1 commit intomainfrom
staging
Feb 12, 2026
Merged

fix: reorganize data loading and auto-refresh logic in SiteDashboardP…#25
uz1mani merged 1 commit intomainfrom
staging

Conversation

@uz1mani
Copy link
Copy Markdown
Member

@uz1mani uz1mani commented Feb 12, 2026

fix: reorganize data loading and auto-refresh logic in SiteDashboardPage for improved clarity and maintainability

…age for improved clarity and maintainability
@uz1mani uz1mani self-assigned this Feb 12, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Feb 12, 2026

Greptile Overview

Greptile Summary

This PR reorganizes the placement of the auto-refresh useEffect hook in SiteDashboardPage, moving it from line 130 to line 209 (after the loadData and loadRealtime callback definitions). This is a code maintainability improvement that groups the effect closer to the callbacks it depends on, making the code easier to understand.

Key changes:

  • Moved auto-refresh useEffect hook to appear after loadData and loadRealtime callbacks
  • No functional changes - dependencies, logic, and behavior remain identical
  • Improved code organization by placing the effect near the functions it uses

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is purely organizational - moving a useEffect hook without modifying its logic, dependencies, or behavior. The hook still has the same dependencies ([siteId, dateRange, todayInterval, multiDayInterval, isSettingsLoaded, loadData, loadRealtime]) and executes the same logic. Moving it after the callback definitions it depends on is actually a best practice improvement.
  • No files require special attention

Important Files Changed

Filename Overview
app/sites/[id]/page.tsx Repositioned auto-refresh effect hook after callback definitions for better code organization - no functional changes

@uz1mani uz1mani merged commit d35d206 into main Feb 12, 2026
1 check passed
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.

1 participant