Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#402·quicklink

Avoid Triggering Requests while offline

Author: gilbertococchiCreated Sep 17, 2023Updated Sep 17, 2023

QuickLink should avoid triggering Network requests when the device is offline.

It should be relatively easy to fix this by adding this code in the checkConnection function.

if("onLine" in navigator && !navigator.onLine) {
  return new Error('Device is offline');
}

Source: GoogleChromeLabs/quicklink

View original on GitHubView discussion on GitHub