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

Commit 3093c3f2 authored by Md.Hasib Prince's avatar Md.Hasib Prince Committed by Hasib Prince
Browse files

App Lounge: Refactoring

parent 47ba3373
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -94,4 +94,17 @@ class FusedAPIRepository @Inject constructor(
    suspend fun listApps(category: String, browseUrl: String, authData: AuthData): List<FusedApp>? {
        return fusedAPIImpl.listApps(category, browseUrl, authData)
    }

    suspend fun getAppsListBasedOnCategory(
        category: String,
        browseUrl: String,
        authData: AuthData,
        source: String
    ): List<FusedApp> {
        return when (source) {
            "Open Source" -> fusedAPIImpl.getOpenSourceApps(category) ?: listOf()
            "PWA" -> fusedAPIImpl.getPWAApps(category) ?: listOf()
            else -> fusedAPIImpl.getPlayStoreApps(browseUrl, authData)
        }
    }
}