From 1751a2a4bc207ccb40ac3c1ad577d84088921df4 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 19 Feb 2024 15:31:17 +0100 Subject: [PATCH] Fix coroutine behavior We should wait for getValidatedAuthData() to be done before checking authenticatorRepository.gplayAuth value. --- .../install/splitinstall/SplitInstallBinder.kt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt b/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt index aad39a2d7..b4574c653 100644 --- a/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt +++ b/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt @@ -71,15 +71,11 @@ class SplitInstallBinder( try { coroutineScope.launch { authenticatorRepository.getValidatedAuthData() - } - - if (authenticatorRepository.gplayAuth == null) { - Timber.w(AUTH_DATA_ERROR_MESSAGE) - handleError(packageName) - return - } - - coroutineScope.launch { + if (authenticatorRepository.gplayAuth == null) { + Timber.w(AUTH_DATA_ERROR_MESSAGE) + handleError(packageName) + return@launch + } downloadModule(packageName, moduleName) } } catch (exception: GPlayLoginException) { -- GitLab