File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -163,26 +163,28 @@ extension Analytics {
163
163
}
164
164
self . store. dispatch ( action: System . ToggleRunningAction ( running: true ) )
165
165
}
166
-
166
+
167
167
return
168
168
}
169
169
#endif
170
-
170
+
171
171
let writeKey = self . configuration. values. writeKey
172
172
let httpClient = HTTPClient ( analytics: self )
173
-
173
+
174
174
// stop things; queue in case our settings have changed.
175
175
store. dispatch ( action: System . ToggleRunningAction ( running: false ) )
176
176
httpClient. settingsFor ( writeKey: writeKey) { ( success, settings) in
177
- if success {
178
- if let s = settings {
179
- // put the new settings in the state store.
180
- // this will cause them to be cached.
181
- self . store. dispatch ( action: System . UpdateSettingsAction ( settings: s) )
182
- // let plugins know we just received some settings..
183
- self . update ( settings: s)
184
- }
177
+ if success, let s = settings {
178
+ // put the new settings in the state store.
179
+ // this will cause them to be cached.
180
+ self . store. dispatch ( action: System . UpdateSettingsAction ( settings: s) )
181
+ }
182
+
183
+ // let plugins know our current settings..
184
+ if let state: System = self . store. currentState ( ) , let s = state. settings {
185
+ self . update ( settings: s)
185
186
}
187
+
186
188
// we're good to go back to a running state.
187
189
self . store. dispatch ( action: System . ToggleRunningAction ( running: true ) )
188
190
}
You can’t perform that action at this time.
0 commit comments