refactor: reduce # of API calls on Home screen on config change
Description
Moved API calls to MainActivityViewModel's init{} block. Having them on MainActivity's onCreate was causing unnecessary API calls on configuration changes.
Screenshots
Technical details
The number of the following API invocation have been reduced on configuration changes:
GET https://f-droid.org/repo/status/update.json
GET https://gitlab.e.foundation/e/os/app-lounge-content-ratings/-/raw/main/content_ratings.json?ref_type=heads
Tests
Issues
https://gitlab.e.foundation/e/os/backlog/-/issues/2808
10 commandments of code reviews
Summary by CodeRabbit
-
New Features
- Enhanced navigation logic based on terms of service acceptance.
- Improved logging for internet connection status.
-
Bug Fixes
- Streamlined activity lifecycle management for better handling of user authentication and internet connectivity.
-
Chores
- Removed redundant view model calls during app initialization to optimize performance.
Edited by Fahim Masud Choudhury