Skip to content

Commit 7d213fd

Browse files
di reinitialization fix
1 parent bd1f84c commit 7d213fd

File tree

1 file changed

+7
-2
lines changed
  • sdk/src/main/java/cloud/mindbox/mobile_sdk

1 file changed

+7
-2
lines changed

sdk/src/main/java/cloud/mindbox/mobile_sdk/Mindbox.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ object Mindbox {
8989

9090
private val mutex = Mutex()
9191

92+
private var diInitialized: Boolean = false
93+
9294
/**
9395
* Allows you to specify additional components for message handling
9496
* when calling the [handleRemoteMessage] function.
@@ -354,8 +356,11 @@ object Mindbox {
354356
) {
355357
LoggingExceptionHandler.runCatching {
356358
initComponents(context, pushServices)
357-
startKoin {
358-
modules(appModule, dataModule)
359+
if (!diInitialized) {
360+
startKoin {
361+
modules(appModule, dataModule)
362+
}
363+
diInitialized = true
359364
}
360365
initScope.launch {
361366
val checkResult = checkConfig(configuration)

0 commit comments

Comments
 (0)