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

Commit e3cdb6b2 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

issue_5413_2: create getApplicationDetailsOSS() in ApplicationViewModel

parent 84aa4454
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -72,6 +72,20 @@ class ApplicationViewModel @Inject constructor(
        }
    }

    fun getApplicationDetailsOSS(id: String) {
        viewModelScope.launch(Dispatchers.IO) {
            try {
                fusedApp.postValue(
                    fusedAPIRepository.getApplicationDetailsOSS(id)
                )
            } catch (e: ApiException.AppNotFound) {
                _errorMessageLiveData.postValue(R.string.app_not_found)
            } catch (e: Exception) {
                _errorMessageLiveData.postValue(R.string.unknown_error)
            }
        }
    }

    /*
     * Dedicated method to get app details from cleanapk using package name.
     * Issue: https://gitlab.e.foundation/e/backlog/-/issues/5509