[RN] Coding style
This commit is contained in:
parent
571958cf26
commit
207393d98e
|
@ -83,10 +83,10 @@ void loadCustomFonts(Class clazz) {
|
||||||
*/
|
*/
|
||||||
void registerFatalErrorHandler() {
|
void registerFatalErrorHandler() {
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
// In the Release configuration, React Native will (intentionally) raise
|
// In the Release configuration, React Native will (intentionally) raise an
|
||||||
// an unhandled NSException for an unhandled JavaScript error. This will
|
// unhandled NSException for an unhandled JavaScript error. This will
|
||||||
// effectively kill the application. In accord with the Web, do not kill
|
// effectively kill the application. In accord with the Web, do not kill the
|
||||||
// the application.
|
// application.
|
||||||
if (!RCTGetFatalHandler()) {
|
if (!RCTGetFatalHandler()) {
|
||||||
RCTSetFatalHandler(_RCTFatal);
|
RCTSetFatalHandler(_RCTFatal);
|
||||||
}
|
}
|
||||||
|
@ -230,28 +230,28 @@ static NSMapTable<NSString *, JitsiMeetView *> *views;
|
||||||
- (void)loadURLObject:(NSDictionary *)urlObject {
|
- (void)loadURLObject:(NSDictionary *)urlObject {
|
||||||
NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
[props setObject:externalAPIScope forKey:@"externalAPIScope"];
|
props[@"externalAPIScope"] = externalAPIScope;
|
||||||
[props setObject:@(self.welcomePageEnabled) forKey:@"welcomePageEnabled"];
|
props[@"welcomePageEnabled"] = @(self.welcomePageEnabled);
|
||||||
|
|
||||||
// XXX url must not be set when nil, so it appears as undefined in JS and we
|
// XXX If urlObject is nil, then it must appear as undefined in the
|
||||||
// check the launch parameters.
|
// JavaScript source code so that we check the launchOptions there.
|
||||||
if (urlObject) {
|
if (urlObject) {
|
||||||
[props setObject:urlObject forKey:@"url"];
|
props[@"url"] = urlObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rootView == nil) {
|
if (rootView) {
|
||||||
|
// Update props with the new URL.
|
||||||
|
rootView.appProperties = props;
|
||||||
|
} else {
|
||||||
rootView
|
rootView
|
||||||
= [[RCTRootView alloc] initWithBridge:bridgeWrapper.bridge
|
= [[RCTRootView alloc] initWithBridge:bridgeWrapper.bridge
|
||||||
moduleName:@"App"
|
moduleName:@"App"
|
||||||
initialProperties:props];
|
initialProperties:props];
|
||||||
rootView.backgroundColor = self.backgroundColor;
|
rootView.backgroundColor = self.backgroundColor;
|
||||||
|
|
||||||
// Add React's root view as a subview which completely covers this one.
|
// Add rootView as a subview which completely covers this one.
|
||||||
[rootView setFrame:[self bounds]];
|
[rootView setFrame:[self bounds]];
|
||||||
[self addSubview:rootView];
|
[self addSubview:rootView];
|
||||||
} else {
|
|
||||||
// Update props with the new URL.
|
|
||||||
rootView.appProperties = props;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,8 +274,8 @@ static NSMapTable<NSString *, JitsiMeetView *> *views;
|
||||||
*
|
*
|
||||||
* @param url - The {@code NSURL} to load in all existing
|
* @param url - The {@code NSURL} to load in all existing
|
||||||
* {@code JitsiMeetView}s.
|
* {@code JitsiMeetView}s.
|
||||||
* @return {@code YES} if the specified {@code url} was submitted for loading
|
* @return {@code YES} if the specified {@code url} was submitted for loading in
|
||||||
* in at least one {@code JitsiMeetView}; otherwise, {@code NO}.
|
* at least one {@code JitsiMeetView}; otherwise, {@code NO}.
|
||||||
*/
|
*/
|
||||||
+ (BOOL)loadURLInViews:(NSURL *)url {
|
+ (BOOL)loadURLInViews:(NSURL *)url {
|
||||||
BOOL handled = NO;
|
BOOL handled = NO;
|
||||||
|
@ -329,9 +329,9 @@ static NSMapTable<NSString *, JitsiMeetView *> *views;
|
||||||
[views setObject:self forKey:externalAPIScope];
|
[views setObject:self forKey:externalAPIScope];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a background color which is in accord with the JavaScript and
|
// Set a background color which is in accord with the JavaScript and Android
|
||||||
// Android parts of the application and causes less perceived visual
|
// parts of the application and causes less perceived visual flicker than
|
||||||
// flicker than the default background color.
|
// the default background color.
|
||||||
self.backgroundColor
|
self.backgroundColor
|
||||||
= [UIColor colorWithRed:.07f green:.07f blue:.07f alpha:1];
|
= [UIColor colorWithRed:.07f green:.07f blue:.07f alpha:1];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue