diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5a278cbc2..17d60b28b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -187,7 +187,7 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.6") - implementation("it.vercruysse.lemmyapi:lemmy-api-jvm:0.1.0-SNAPSHOT") + implementation("it.vercruysse.lemmyapi:lemmy-api:0.2.0-SNAPSHOT") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1") // Ktor uses SLF4J implementation("org.slf4j:slf4j-api:2.0.9") diff --git a/app/src/main/java/com/jerboa/db/entity/Account.kt b/app/src/main/java/com/jerboa/db/entity/Account.kt index 2592d3050..4205d168a 100644 --- a/app/src/main/java/com/jerboa/db/entity/Account.kt +++ b/app/src/main/java/com/jerboa/db/entity/Account.kt @@ -48,7 +48,3 @@ fun Account.isAnon(): Boolean { fun Account.isReady(): Boolean { return this.verificationState == AccountVerificationState.CHECKS_COMPLETE.ordinal } - -fun Account.getJWT(): String? { - return if (isAnon()) null else this.jwt -} diff --git a/app/src/main/java/com/jerboa/feat/AccountVerificationState.kt b/app/src/main/java/com/jerboa/feat/AccountVerificationState.kt index 9e0c7fa5c..323c30a6b 100644 --- a/app/src/main/java/com/jerboa/feat/AccountVerificationState.kt +++ b/app/src/main/java/com/jerboa/feat/AccountVerificationState.kt @@ -421,13 +421,15 @@ suspend fun Account.isReadyAndIfNotDisplayInfo( } AccountVerificationState.ACCOUNT_DELETED to CheckState.Failed -> { - accountVM.deleteAccountAndSwapCurrent(this, swapToAnon = true) - appState.toHome() + accountVM.deleteAccountAndSwapCurrent(this, swapToAnon = true).invokeOnCompletion { + appState.toLogin() + } } AccountVerificationState.JWT_VERIFIED to CheckState.Failed -> { - accountVM.deleteAccountAndSwapCurrent(this, swapToAnon = true) - appState.toLogin() + accountVM.deleteAccountAndSwapCurrent(this, swapToAnon = true).invokeOnCompletion { + appState.toLogin() + } } else ->