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

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

fixed: overriding currentHomes

parent e71869ad
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
        }