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 {
163163 }
164164 self . store. dispatch ( action: System . ToggleRunningAction ( running: true ) )
165165 }
166-
166+
167167 return
168168 }
169169 #endif
170-
170+
171171 let writeKey = self . configuration. values. writeKey
172172 let httpClient = HTTPClient ( analytics: self )
173-
173+
174174 // stop things; queue in case our settings have changed.
175175 store. dispatch ( action: System . ToggleRunningAction ( running: false ) )
176176 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)
185186 }
187+
186188 // we're good to go back to a running state.
187189 self . store. dispatch ( action: System . ToggleRunningAction ( running: true ) )
188190 }
You can’t perform that action at this time.
0 commit comments