Move setDefaults call to constructor.
Reviewed By: javache Differential Revision: D3514703 fbshipit-source-id: 8195778b23868eae36a55edc2d5d4f148b36a12e
This commit is contained in:
parent
85983d0ae4
commit
a9a0ff267f
|
@ -32,18 +32,22 @@ static NSString *ipGuess;
|
|||
}
|
||||
#endif
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self setDefaults];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSDictionary *)defaults
|
||||
{
|
||||
static NSDictionary *defaults;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
defaults = @{
|
||||
kRCTEnableLiveReloadKey: @NO,
|
||||
kRCTEnableDevKey: @YES,
|
||||
kRCTEnableMinificationKey: @NO,
|
||||
};
|
||||
});
|
||||
return defaults;
|
||||
return @{
|
||||
kRCTEnableLiveReloadKey: @NO,
|
||||
kRCTEnableDevKey: @YES,
|
||||
kRCTEnableMinificationKey: @NO,
|
||||
};
|
||||
}
|
||||
|
||||
- (void)settingsUpdated
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
{
|
||||
NSURL *jsCodeLocation;
|
||||
|
||||
[[RCTBundleURLProvider sharedSettings] setDefaults];
|
||||
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
|
||||
|
||||
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
|
||||
|
|
Loading…
Reference in New Issue