Skip to content

Commit ae8aa7b

Browse files
committed
Code review
1 parent 01d9d02 commit ae8aa7b

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

ios/RNInAppBrowser.m

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ + (BOOL)requiresMainQueueSetup
7070
BOOL ephemeralWebSession = [options[@"ephemeralWebSession"] boolValue];
7171

7272
if (@available(iOS 11, *)) {
73-
NSURL *url = [[NSURL alloc] initWithString: authURL];
73+
NSURL *url = [[NSURL alloc] initWithString:authURL];
7474
__weak typeof(self) weakSelf = self;
7575
void (^completionHandler)(NSURL * _Nullable, NSError *_Nullable) = ^(NSURL* _Nullable callbackURL, NSError* _Nullable error) {
7676
__strong typeof(weakSelf) strongSelf = weakSelf;
@@ -151,24 +151,24 @@ + (BOOL)requiresMainQueueSetup
151151
modalEnabled = [options[@"modalEnabled"] boolValue];
152152
animated = [options[@"animated"] boolValue];
153153

154-
// Safari View Controller to authorize request
155-
NSURL *url = [[NSURL alloc] initWithString:authURL];
156-
if (@available(iOS 11.0, *)) {
157-
SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init];
158-
config.barCollapsingEnabled = enableBarCollapsing;
159-
config.entersReaderIfAvailable = readerMode;
160-
@try {
154+
@try {
155+
// Safari View Controller to authorize request
156+
NSURL *url = [[NSURL alloc] initWithString:authURL];
157+
if (@available(iOS 11.0, *)) {
158+
SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init];
159+
config.barCollapsingEnabled = enableBarCollapsing;
160+
config.entersReaderIfAvailable = readerMode;
161161
safariVC = [[SFSafariViewController alloc] initWithURL:url configuration:config];
162+
} else {
163+
safariVC = [[SFSafariViewController alloc] initWithURL:url entersReaderIfAvailable:readerMode];
162164
}
163-
@catch (NSException *exception) {
164-
reject(RNInAppBrowserErrorCode, @"Unable to open url.", nil);
165-
[self _close];
166-
NSLog(@"CRASH: %@", exception);
167-
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
168-
return;
169-
}
170-
} else {
171-
safariVC = [[SFSafariViewController alloc] initWithURL:url entersReaderIfAvailable:readerMode];
165+
}
166+
@catch (NSException *exception) {
167+
reject(RNInAppBrowserErrorCode, @"Unable to open url.", nil);
168+
[self _close];
169+
NSLog(@"CRASH: %@", exception);
170+
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
171+
return;
172172
}
173173
safariVC.delegate = self;
174174
if (@available(iOS 11.0, *)) {

0 commit comments

Comments
 (0)