Loading app/src/main/java/foundation/e/apps/data/fused/FusedApiImpl.kt +3 −3 Original line number Diff line number Diff line Loading @@ -1229,7 +1229,7 @@ class FusedApiImpl @Inject constructor( * Recommended to use this instead of [PkgManagerModule.getPackageStatus]. */ override fun getFusedAppInstallationStatus(fusedApp: FusedApp): Status { return if (fusedApp.is_pwa) { return if (fusedApp.isPwa) { pwaManagerModule.getPwaStatus(fusedApp) } else { pkgManagerModule.getPackageStatus(fusedApp.package_name, fusedApp.latest_version_code) Loading @@ -1243,12 +1243,12 @@ class FusedApiImpl @Inject constructor( } private fun FusedApp.updateType() { this.type = if (this.is_pwa) Type.PWA else Type.NATIVE this.type = if (this.isPwa) Type.PWA else Type.NATIVE } private fun FusedApp.updateSource() { this.apply { source = if (origin == Origin.CLEANAPK && is_pwa) { source = if (origin == Origin.CLEANAPK && isPwa) { context.getString(R.string.pwa) } else if (origin == Origin.CLEANAPK) { context.getString(R.string.open_source) Loading app/src/main/java/foundation/e/apps/data/fused/data/FusedApp.kt +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ data class FusedApp( var source: String = String(), val price: String = String(), val isFree: Boolean = true, val is_pwa: Boolean = false, val isPwa: Boolean = false, var pwaPlayerDbId: Long = -1, val url: String = String(), var type: Type = Type.NATIVE, Loading app/src/main/java/foundation/e/apps/domain/login/usecase/UserLoginUseCase.kt +6 −12 Original line number Diff line number Diff line Loading @@ -34,16 +34,14 @@ class UserLoginUseCase @Inject constructor( ) { fun anonymousUser(): Flow<Resource<AuthData>> = flow { try { kotlin.runCatching { emit(Resource.Loading()) emit(Resource.Success(loginRepository.anonymousUser())) } catch (e: Exception) { emit(Resource.Error(e.localizedMessage)) } }.onFailure { failure -> emit(Resource.Error(failure.localizedMessage)) } } fun googleUser(authData: AuthData, token: String): Flow<Resource<Unit>> = flow { try { kotlin.runCatching { emit( Resource.Success( loginRepository.googleUser( Loading @@ -52,18 +50,14 @@ class UserLoginUseCase @Inject constructor( ) ) ) } catch (e: Exception) { emit(Resource.Error(e.localizedMessage)) } }.onFailure { failure -> emit(Resource.Error(failure.localizedMessage)) } } fun retrieveCachedAuthData(): Flow<Resource<AuthData>> = flow { try { kotlin.runCatching { emit(Resource.Loading()) emit(Resource.Success(cacheRepository.cacheAuthData())) } catch (e: Exception) { emit(Resource.Error(e.localizedMessage)) } }.onFailure { failure -> emit(Resource.Error(failure.localizedMessage)) } } fun logoutUser() { Loading app/src/main/java/foundation/e/apps/presentation/login/LoginViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ class LoginViewModel @Inject constructor( */ fun initialNoGoogleLogin(onUserSaved: () -> Unit) { viewModelScope.launch { loginSourceRepository.setNoGoogleMode() val authObject = noGoogleModeUseCase.performNoGoogleLogin() _loginState.value = LoginState(isLoading = false, isLoggedIn = true) authObjects.postValue(listOf(authObject)) Loading app/src/main/java/foundation/e/apps/ui/application/ApplicationFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -754,7 +754,7 @@ class ApplicationFragment : Fragment(R.layout.fragment_application) { backgroundTintList = ContextCompat.getColorStateList(view.context, R.color.colorAccent) setOnClickListener { if (fusedApp.is_pwa) { if (fusedApp.isPwa) { pwaManagerModule.launchPwa(fusedApp) } else { startActivity(pkgManagerModule.getLaunchIntent(fusedApp.package_name)) Loading Loading
app/src/main/java/foundation/e/apps/data/fused/FusedApiImpl.kt +3 −3 Original line number Diff line number Diff line Loading @@ -1229,7 +1229,7 @@ class FusedApiImpl @Inject constructor( * Recommended to use this instead of [PkgManagerModule.getPackageStatus]. */ override fun getFusedAppInstallationStatus(fusedApp: FusedApp): Status { return if (fusedApp.is_pwa) { return if (fusedApp.isPwa) { pwaManagerModule.getPwaStatus(fusedApp) } else { pkgManagerModule.getPackageStatus(fusedApp.package_name, fusedApp.latest_version_code) Loading @@ -1243,12 +1243,12 @@ class FusedApiImpl @Inject constructor( } private fun FusedApp.updateType() { this.type = if (this.is_pwa) Type.PWA else Type.NATIVE this.type = if (this.isPwa) Type.PWA else Type.NATIVE } private fun FusedApp.updateSource() { this.apply { source = if (origin == Origin.CLEANAPK && is_pwa) { source = if (origin == Origin.CLEANAPK && isPwa) { context.getString(R.string.pwa) } else if (origin == Origin.CLEANAPK) { context.getString(R.string.open_source) Loading
app/src/main/java/foundation/e/apps/data/fused/data/FusedApp.kt +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ data class FusedApp( var source: String = String(), val price: String = String(), val isFree: Boolean = true, val is_pwa: Boolean = false, val isPwa: Boolean = false, var pwaPlayerDbId: Long = -1, val url: String = String(), var type: Type = Type.NATIVE, Loading
app/src/main/java/foundation/e/apps/domain/login/usecase/UserLoginUseCase.kt +6 −12 Original line number Diff line number Diff line Loading @@ -34,16 +34,14 @@ class UserLoginUseCase @Inject constructor( ) { fun anonymousUser(): Flow<Resource<AuthData>> = flow { try { kotlin.runCatching { emit(Resource.Loading()) emit(Resource.Success(loginRepository.anonymousUser())) } catch (e: Exception) { emit(Resource.Error(e.localizedMessage)) } }.onFailure { failure -> emit(Resource.Error(failure.localizedMessage)) } } fun googleUser(authData: AuthData, token: String): Flow<Resource<Unit>> = flow { try { kotlin.runCatching { emit( Resource.Success( loginRepository.googleUser( Loading @@ -52,18 +50,14 @@ class UserLoginUseCase @Inject constructor( ) ) ) } catch (e: Exception) { emit(Resource.Error(e.localizedMessage)) } }.onFailure { failure -> emit(Resource.Error(failure.localizedMessage)) } } fun retrieveCachedAuthData(): Flow<Resource<AuthData>> = flow { try { kotlin.runCatching { emit(Resource.Loading()) emit(Resource.Success(cacheRepository.cacheAuthData())) } catch (e: Exception) { emit(Resource.Error(e.localizedMessage)) } }.onFailure { failure -> emit(Resource.Error(failure.localizedMessage)) } } fun logoutUser() { Loading
app/src/main/java/foundation/e/apps/presentation/login/LoginViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ class LoginViewModel @Inject constructor( */ fun initialNoGoogleLogin(onUserSaved: () -> Unit) { viewModelScope.launch { loginSourceRepository.setNoGoogleMode() val authObject = noGoogleModeUseCase.performNoGoogleLogin() _loginState.value = LoginState(isLoading = false, isLoggedIn = true) authObjects.postValue(listOf(authObject)) Loading
app/src/main/java/foundation/e/apps/ui/application/ApplicationFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -754,7 +754,7 @@ class ApplicationFragment : Fragment(R.layout.fragment_application) { backgroundTintList = ContextCompat.getColorStateList(view.context, R.color.colorAccent) setOnClickListener { if (fusedApp.is_pwa) { if (fusedApp.isPwa) { pwaManagerModule.launchPwa(fusedApp) } else { startActivity(pkgManagerModule.getLaunchIntent(fusedApp.package_name)) Loading