File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
core/src/main/java/com/segment/analytics/kotlin/core Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,16 @@ suspend fun Analytics.checkSettings() {
92
92
val settingsObj: Settings ? = fetchSettings(writeKey, cdnHost)
93
93
94
94
withContext(analyticsDispatcher) {
95
- settingsObj?.let {
95
+
96
+ val systemState = store.currentState(System ::class )
97
+ val defaultSettings = systemState?.settings
98
+
99
+
100
+ if (settingsObj == null ) {
101
+ defaultSettings?.let {
102
+ update(defaultSettings)
103
+ }
104
+ } else {
96
105
log(" Dispatching update settings on ${Thread .currentThread().name} " )
97
106
store.dispatch(System .UpdateSettingsAction (settingsObj), System ::class )
98
107
update(settingsObj)
@@ -125,5 +134,5 @@ internal fun Analytics.fetchSettings(
125
134
it[" writekey" ] = writeKey
126
135
it[" message" ] = " Error retrieving settings"
127
136
}
128
- configuration.defaultSettings
137
+ null
129
138
}
You can’t perform that action at this time.
0 commit comments