Skip to content

Handle offline state and prevent unnecessary AQI API requests#100

Merged
Aditya8369 merged 2 commits into
Aditya8369:mainfrom
shambhavi-chandrawat:fix/offline-handling
Jul 9, 2026
Merged

Handle offline state and prevent unnecessary AQI API requests#100
Aditya8369 merged 2 commits into
Aditya8369:mainfrom
shambhavi-chandrawat:fix/offline-handling

Conversation

@shambhavi-chandrawat

@shambhavi-chandrawat shambhavi-chandrawat commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

Improved the application's offline handling by detecting network connectivity before making AQI API requests. The application now prevents unnecessary requests while offline, displays a clear offline message, and automatically resumes fetching data once the internet connection is restored.


Related Issue

Closes #73


Type of Change

  • Bug Fix
  • New Feature
  • Documentation
  • UI/UX Improvement
  • Refactoring
  • Performance Improvement
  • Accessibility

Changes Made

  • Added offline detection before making AQI API requests.
  • Prevented unnecessary API calls when there is no internet connection.
  • Displayed a clear offline error message and prevented rendering of AQI components when data is unavailable.
  • Automatically resumed fetching AQI data after the network connection was restored.

Testing

  • Tested locally
  • No console errors
  • Existing functionality works as expected

Screenshots

Offline state
Screenshot 2026-07-07 at 11 20 42 PM

Automatic recovery after reconnecting
Auto-refreshing after internet connection.zip


Checklist

  • My code follows the project guidelines.
  • I have tested my changes.
  • I have updated the documentation if required.
  • My changes address the related issue.
  • This PR focuses on a single issue.

Additional Notes

Verified the following scenarios:

  • Application shows an offline message when there is no internet connection.
  • AQI API requests are not made while offline.
  • AQI data is fetched automatically after reconnecting to the internet.
  • Existing functionality, including city selection and live updates, continues to work as expected.

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

@shambhavi-chandrawat is attempting to deploy a commit to the Aditya Mahajan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Aditya8369

Copy link
Copy Markdown
Owner

@shambhavi-chandrawat resolve merge conflicts please

@Aditya8369 Aditya8369 added ECSoC26 Contributions considered under ECSoC'26 merge-conflicts labels Jul 8, 2026
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
pollution-control-hub Ready Ready Preview, Comment Jul 9, 2026 2:11pm

@Aditya8369 Aditya8369 merged commit e84a2f4 into Aditya8369:main Jul 9, 2026
3 checks passed
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🎉 Your PR just got merged, @shambhavi-chandrawat — thank you for contributing to Pollution Control Hub!

Your work is now part of the project. Here's what to do next:

  • ⭐ If you haven't already, consider giving the repo a star — it helps us grow.
  • 📢 Share your contribution on LinkedIn, Twitter, or wherever you hang out. You shipped open source!
  • 🔍 Browse other open issues if you want to keep contributing.

We really appreciate you taking the time. See you in the next PR! 🚀

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

Labels

ECSoC26-L1 ECSoC26 Contributions considered under ECSoC'26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ECSOC] Handle offline state gracefully and prevent unnecessary AQI API requests

2 participants