File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Analytics/Classes/Integrations Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -394,14 +394,19 @@ - (void)refreshSettings
394
394
if (success) {
395
395
[self setCachedSettings: settings];
396
396
} else {
397
- // If settings request fail, fall back to using just Segment integration.
398
- // Doesn't address situations where this callback never gets called (though we don't expect that to ever happen).
399
- [self setCachedSettings: @{
400
- @" integrations" : @{
401
- @" Segment.io" : @{@" apiKey" : self.configuration .writeKey },
402
- },
403
- @" plan" : @{@" track" : @{}}
404
- }];
397
+ NSDictionary *previouslyCachedSettings = [self cachedSettings ];
398
+ if (previouslyCachedSettings) {
399
+ [self setCachedSettings: previouslyCachedSettings];
400
+ } else {
401
+ // If settings request fail, fall back to using just Segment integration.
402
+ // Doesn't address situations where this callback never gets called (though we don't expect that to ever happen).
403
+ [self setCachedSettings: @{
404
+ @" integrations" : @{
405
+ @" Segment.io" : @{@" apiKey" : self.configuration .writeKey },
406
+ },
407
+ @" plan" : @{@" track" : @{}}
408
+ }];
409
+ }
405
410
}
406
411
self.settingsRequest = nil ;
407
412
});
You can’t perform that action at this time.
0 commit comments