Improve Error Message when Offline
Currently the app shows error messages when the device does not have connectivity (see image below). We can improve this by showing a general message like on the home page or we could disable refresh to not reload the providers at all.
Hey @nav-28, I was thinking on taking this issue, however, I see a more generic message when I don't have connectivity on that screen ("Could not load live streamers"). Could you provide some more info please?
That specific error in my screenshot occurs when the data is already loaded and the devices loses connectivity. So after loading the data, disconnect the device and try refreshing the list it should give the error.
Generally, I think it should say something about the device's connectivity other than "Could not load live streamers". See the home page for an example.
Also if the data is already loaded you could disable refreshing if there is no connectivity.
Let me share with you how is behaving for me:
https://github.com/lichess-org/mobile/assets/54546499/e37191f7-d9f7-4c99-a8a1-3fde6e0e3213
Device: Android, Galaxy A13 API 33.
- Notice I'm not getting the same error than you on the streamers list.
- After recovering connection I cannot refresh so it's not possible to recover Streamer Widget.
I managed to get the same error on the streamers list harcoding an invalid url when showing StreamerListTile Image.network(streamer.image)
I think I'm ready to work on:
- Improve error message, same as Home Screen.
- Disable swipe to refresh when data is loaded and there is no connectivity.
- Show a generic image when there is and error fetching it. What do you think about this one @nav-28 ?
Let's go with improving the error messages and disabling refresh when there is no connectivity.
I also have not been able to reproduce the image error, maybe something changes since I last created the issue. So, let's not put any generic image for now.
Couldn't find a naive approach to disable refresh on iOS (CupertinoSliverRefreshControl). We can allow to refresh on iOS but not reload streamers providers, what do you think?
What do you mean? I believe you can just set the callback to null
onRefresh: isNowOnline
? () => ref.refresh(liveStreamersProvider.future)
: null,