Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

refactor: reduce # of API calls on Home screen on config change

Fahim Masud Choudhury requested to merge 0000-reduce-api-call-home into main

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

👪 https://gitlab.e.foundation/internal/wiki/-/wikis/mobile-team/guidelines/Code-review

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

Merge request reports

Loading