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

Commit 3c9073c2 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

issue_5413 [WIP]: update other uses of updatesList in UpdatesViewModel for ResultSupreme

parent 69503e90
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -44,11 +44,9 @@ class UpdatesViewModel @Inject constructor(
    fun getUpdates(authData: AuthData) {
        viewModelScope.launch {
            val updatesResult = updatesManagerRepository.getUpdates(authData)
            val filteredList = updatesResult.data?.filter { !(!it.isFree && authData.isAnonymous) } ?: listOf()
            updatesList.postValue(
                Pair(
                    updatesResult.first.filter { !(!it.isFree && authData.isAnonymous) },
                    updatesResult.second
                )
                ResultSupreme.replicate(updatesResult, filteredList)
            )
        }
    }
@@ -78,7 +76,7 @@ class UpdatesViewModel @Inject constructor(

    private fun checkWorkIsForUpdateByTag(tags: List<String>): Boolean {
        updatesList.value?.let {
            it.first.find { fusedApp -> tags.contains(fusedApp._id) }?.let { foundApp ->
            it.data?.find { fusedApp -> tags.contains(fusedApp._id) }?.let { foundApp ->
                return listOf(
                    Status.INSTALLED,
                    Status.UPDATABLE