diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 1c2adea915..3bc938d2f8 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -95,18 +95,6 @@ class MainApp : DaggerApplication() { gitRemote = null commitHash = null } - disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() - if (sp.getBoolean(R.string.key_ns_logappstartedevent, config.APS)) - disposable += repository - .runTransaction( - InsertIfNewByTimestampTherapyEventTransaction( - timestamp = dateUtil.now(), - type = TherapyEvent.Type.NOTE, - note = getString(info.nightscout.androidaps.core.R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL, - glucoseUnit = TherapyEvent.GlucoseUnit.MGDL - ) - ) - .subscribe() disposable += compatDBHelper.dbChangeDisposable() registerActivityLifecycleCallbacks(activityMonitor) JodaTimeAndroid.init(this) @@ -126,6 +114,18 @@ class MainApp : DaggerApplication() { pluginStore.plugins = plugins configBuilder.initialize() + disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() + if (sp.getBoolean(R.string.key_ns_logappstartedevent, config.APS)) + disposable += repository + .runTransaction( + InsertIfNewByTimestampTherapyEventTransaction( + timestamp = dateUtil.now(), + type = TherapyEvent.Type.NOTE, + note = getString(info.nightscout.androidaps.core.R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL, + glucoseUnit = TherapyEvent.GlucoseUnit.MGDL + ) + ) + .subscribe() WorkManager.getInstance(this).enqueueUniquePeriodicWork( "KeepAlive", ExistingPeriodicWorkPolicy.REPLACE,