I have an Ionic Vue app that is starting to crawl. It performs two network functions when it boots up:
- AppFlow check - goes out on the internet to see if a new version of the app exists
- Firebase Auth check - is the person authenticated and logged in or not?
- Router kicks in and either keeps them on the page or sends them to intro/login screen
Obviously the splash screen is useful here because it buys time until both of these things happen. But what I’m discovering is when the user is offline/airplane mode the splash screen never goes away and I get the error:
@firebase/firestore: Firestore (8.10.1): Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=unavailable]: The operation could not be completed This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
I would love to display a message after 5 seconds saying we’re still trying to load or something? I’m not sure how to do this and I’m wondering how everybody else handles this?