From d6380c5e6366a4f2f20d992d852834f6ff3fc1dc Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 7 Aug 2023 09:50:51 +0930 Subject: [PATCH] Fix website flavor --- .../securesms/notifications/NoOpPushModule.kt | 8 +++++--- .../securesms/notifications/NoOpTokenFetcher.kt | 12 ++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 app/src/website/kotlin/org/thoughtcrime/securesms/notifications/NoOpTokenFetcher.kt diff --git a/app/src/website/kotlin/org/thoughtcrime/securesms/notifications/NoOpPushModule.kt b/app/src/website/kotlin/org/thoughtcrime/securesms/notifications/NoOpPushModule.kt index af907b51ca..59873c82be 100644 --- a/app/src/website/kotlin/org/thoughtcrime/securesms/notifications/NoOpPushModule.kt +++ b/app/src/website/kotlin/org/thoughtcrime/securesms/notifications/NoOpPushModule.kt @@ -1,5 +1,6 @@ package org.thoughtcrime.securesms.notifications +import dagger.Binds import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -8,6 +9,7 @@ import javax.inject.Singleton @Module @InstallIn(SingletonComponent::class) -class NoOpPushModule { - -} \ No newline at end of file +abstract class NoOpPushModule { + @Binds + abstract fun bindTokenFetcher(tokenFetcher: NoOpTokenFetcher): TokenFetcher +} diff --git a/app/src/website/kotlin/org/thoughtcrime/securesms/notifications/NoOpTokenFetcher.kt b/app/src/website/kotlin/org/thoughtcrime/securesms/notifications/NoOpTokenFetcher.kt new file mode 100644 index 0000000000..1705eefe09 --- /dev/null +++ b/app/src/website/kotlin/org/thoughtcrime/securesms/notifications/NoOpTokenFetcher.kt @@ -0,0 +1,12 @@ +package org.thoughtcrime.securesms.notifications + +import kotlinx.coroutines.Job +import kotlinx.coroutines.MainScope +import kotlinx.coroutines.launch +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +class NoOpTokenFetcher @Inject constructor() : TokenFetcher { + override fun fetch(): Job = MainScope().launch { } +}