mirror of
https://github.com/thunderbird/thunderbird-android.git
synced 2024-09-19 19:52:14 +02:00
Disable koin override behaviour and fix doubled Clock.System inject definition
This commit is contained in:
parent
ebf03d3a01
commit
b9370bc6f3
@ -10,6 +10,7 @@ class FeatureApplication : Application() {
|
||||
super.onCreate()
|
||||
|
||||
startKoin {
|
||||
allowOverride(false)
|
||||
androidContext(this@FeatureApplication)
|
||||
modules(featureModule)
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ class CatalogApplication : Application() {
|
||||
super.onCreate()
|
||||
|
||||
startKoin {
|
||||
allowOverride(false)
|
||||
androidContext(this@CatalogApplication)
|
||||
modules(catalogUiModule)
|
||||
}
|
||||
|
@ -15,8 +15,10 @@ object DI {
|
||||
private const val DEBUG = false
|
||||
|
||||
@JvmStatic
|
||||
fun start(application: Application, modules: List<Module>) {
|
||||
fun start(application: Application, modules: List<Module>, allowOverride: Boolean = false) {
|
||||
startKoin {
|
||||
allowOverride(allowOverride)
|
||||
|
||||
if (BuildConfig.DEBUG && DEBUG) {
|
||||
androidLogger()
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import com.fsck.k9.mail.ssl.TrustedSocketFactory
|
||||
import com.fsck.k9.mailstore.LocalStoreProvider
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.datetime.Clock
|
||||
import org.koin.core.qualifier.named
|
||||
import org.koin.dsl.module
|
||||
|
||||
@ -32,7 +31,6 @@ val mainModule = module {
|
||||
single { TrustManagerFactory.createInstance(get()) }
|
||||
single { LocalKeyStoreManager(get()) }
|
||||
single<TrustedSocketFactory> { DefaultTrustedSocketFactory(get(), get()) }
|
||||
single<Clock> { Clock.System }
|
||||
factory { EmailAddressValidator() }
|
||||
factory { ServerSettingsSerializer() }
|
||||
}
|
||||
|
@ -20,7 +20,11 @@ class TestApp : Application() {
|
||||
Core.earlyInit()
|
||||
|
||||
super.onCreate()
|
||||
DI.start(this, coreModules + storageModule + testModule)
|
||||
DI.start(
|
||||
application = this,
|
||||
modules = coreModules + storageModule + testModule,
|
||||
allowOverride = true,
|
||||
)
|
||||
|
||||
K9.init(this)
|
||||
Core.init(this)
|
||||
|
@ -11,7 +11,11 @@ class TestApp : Application() {
|
||||
Core.earlyInit()
|
||||
|
||||
super.onCreate()
|
||||
DI.start(this, coreModules + storageModule + testModule)
|
||||
DI.start(
|
||||
application = this,
|
||||
modules = coreModules + storageModule + testModule,
|
||||
allowOverride = true,
|
||||
)
|
||||
|
||||
K9.init(this)
|
||||
Core.init(this)
|
||||
|
Loading…
Reference in New Issue
Block a user