GPlates / gplates-app

GPlates Mobile App
https://www.gplates.org
2 stars 0 forks source link

Check user is on WiFi or cellular data #122

Closed michaelchin closed 1 year ago

michaelchin commented 1 year ago

Investigate how to check user is on WiFi or cellular data. We should give users some warning when they are on cellular data. And we should use the network as little as possible if on cellular data. Children maybe have no much data on their phone.

michaelchin commented 1 year ago

@matthewmerkas Maybe we can make the warning a bit more obvious, such as put a warning sign 🔴🔵🟡 at the right bottom corner? When it is on WIFI->blue, on celluar->yellow, no network->red.

I had written some code to monitor the network status. https://github.com/GPlates/gplates-app/blob/fc27f31c851a8870d51d510384c4e2f7de4a361e/src/pages/Main.tsx#L336-L346 Maybe these code can be improved and integrated into your code. What do you think?

The reason why this warning is important is because we may need to populate the cache in the background. It may use up hundreds of MB data. I don't want to mess up with children's mobile data quota. It may cause riots.

matthew-merkas commented 1 year ago

Yep, okay I'll give it a look. I thought about putting a little warning in the corner but figured the system's status bar was sufficient. Given that we'll be downloading so much, I think an indicator is sensible and maybe the wording of the message needs to be changed a bit