From 0a3f1f641a240e8a3ef156d5e913c4a40f5be45b Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 26 Sep 2022 19:51:15 +0100 Subject: [PATCH] avoiding push token registration when signed out --- app/src/main/kotlin/app/dapk/st/SmallTalkApplication.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/app/dapk/st/SmallTalkApplication.kt b/app/src/main/kotlin/app/dapk/st/SmallTalkApplication.kt index 3fb4488..d2e2f97 100644 --- a/app/src/main/kotlin/app/dapk/st/SmallTalkApplication.kt +++ b/app/src/main/kotlin/app/dapk/st/SmallTalkApplication.kt @@ -54,7 +54,9 @@ class SmallTalkApplication : Application(), ModuleProvider { private fun onApplicationLaunch(notificationsModule: NotificationsModule, storeModule: StoreModule) { applicationScope.launch { - featureModules.pushModule.pushTokenRegistrar().registerCurrentToken() + storeModule.credentialsStore().credentials()?.let { + featureModules.pushModule.pushTokenRegistrar().registerCurrentToken() + } storeModule.localEchoStore.preload() }