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

Commit fc46c00b authored by Hasib Prince's avatar Hasib Prince
Browse files

Merge branch '228-homepage_issue' into 'main'

fixed: overriding currentHomes

Closes #228

See merge request !397
parents 884a341a e98edfeb
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -103,7 +103,10 @@ class HomeViewModel @Inject constructor(
    private fun postHomeResult(homeResult: ResultSupreme<List<Home>>) {
        if (shouldUpdateResult(homeResult)) {
            homeScreenData.value = homeResult
            currentHomes = homeResult.data
            // Here, homeResult.data is a mutableList which can be changed anytime.
            // That's why we're setting copy of the list, so that currentHomes isn't changed,
            // when homeresult.data is changed.
            currentHomes = homeResult.data?.map { it.copy() }
            return
        }