From 519fb6bc38a052b5caefb006f9287f24b0a38fa6 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Thu, 12 Oct 2023 20:07:08 +0530 Subject: [PATCH] PWA label in search list --- .../foundation/e/apps/data/fused/FusedApiImpl.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/data/fused/FusedApiImpl.kt b/app/src/main/java/foundation/e/apps/data/fused/FusedApiImpl.kt index 5aa83c320..be264e01b 100644 --- a/app/src/main/java/foundation/e/apps/data/fused/FusedApiImpl.kt +++ b/app/src/main/java/foundation/e/apps/data/fused/FusedApiImpl.kt @@ -286,10 +286,11 @@ class FusedApiImpl @Inject constructor( val result = handleNetworkResult { val apps = cleanApkPWARepository.getSearchResult(query).body()?.apps - apps?.apply { - if (this.isNotEmpty()) { - pwaApps.addAll(this) - } + apps?.forEach { + it.updateStatus() + it.updateType() + it.updateSource() + pwaApps.add(it) } } @@ -1010,8 +1011,7 @@ class FusedApiImpl @Inject constructor( response?.forEach { it.updateStatus() it.updateType() - it.source = - if (source.contentEquals(CleanApkRetrofit.APP_SOURCE_FOSS)) "Open Source" else "PWA" + it.updateSource() list.add(it) } return list -- GitLab