1- #import " MobileGestalt.h"
21#import " Recovery.h"
32
4- #pragma mark - Gesture Handling
5-
63static NSTimeInterval shakeStartTime = 0 ;
74static BOOL isShaking = NO ;
85static NSHashTable *windowsWithGestures = nil ;
@@ -329,8 +326,6 @@ BOOL isRecoveryModeEnabled(void)
329326 return cell;
330327}
331328
332- #pragma mark - Table View Delegate
333-
334329- (void )tableView : (UITableView *)tableView didSelectRowAtIndexPath : (NSIndexPath *)indexPath
335330{
336331 [tableView deselectRowAtIndexPath: indexPath animated: YES ];
@@ -347,8 +342,6 @@ BOOL isRecoveryModeEnabled(void)
347342 }
348343}
349344
350- #pragma mark - Menu Actions
351-
352345- (void )showDestructiveConfirmation : (NSString *)action selectorName : (NSString *)selectorName
353346{
354347 NSString *message = @" Are you sure you want to do this?" ;
@@ -407,8 +400,6 @@ BOOL isRecoveryModeEnabled(void)
407400 [self dismissViewControllerAnimated: YES completion: ^{ reloadApp (self); }];
408401}
409402
410- #pragma mark - Bundle Management
411-
412403- (void )switchBundleVersion
413404{
414405 UIAlertController *loadingAlert =
@@ -701,8 +692,6 @@ BOOL isRecoveryModeEnabled(void)
701692 [self dismissViewControllerAnimated: YES completion: ^{ reloadApp (self); }];
702693}
703694
704- #pragma mark - Utility Functions
705-
706695- (void )openAppFolder
707696{
708697 if ([Utilities isJailbroken ])
@@ -787,7 +776,17 @@ BOOL isRecoveryModeEnabled(void)
787776 stringWithFormat: @" https://github.com/unbound-app/client/issues/new?title=%@ &body=%@ " ,
788777 encodedTitle, encodedBody];
789778 NSURL *url = [NSURL URLWithString: urlString];
790- [[UIApplication sharedApplication ] openURL: url options: @{} completionHandler: nil ];
779+
780+ if (!url)
781+ {
782+ return ;
783+ }
784+
785+ SFSafariViewController *safari = [[SFSafariViewController alloc ] initWithURL: url];
786+ safari.dismissButtonStyle = SFSafariViewControllerDismissButtonStyleClose;
787+ safari.delegate = self;
788+ safari.modalPresentationStyle = UIModalPresentationPageSheet;
789+ [self presentViewController: safari animated: YES completion: nil ];
791790}
792791
793792- (void )toggleSetting : (UISwitch *)sender
@@ -850,13 +849,16 @@ BOOL isRecoveryModeEnabled(void)
850849 [defaults synchronize ];
851850}
852851
852+ - (void )safariViewControllerDidFinish : (SFSafariViewController *)controller
853+ {
854+ [controller dismissViewControllerAnimated: YES completion: nil ];
855+ }
856+
853857- (void )dismiss
854858{
855859 [self dismissViewControllerAnimated: YES completion: nil ];
856860}
857861
858- #pragma mark - Helper Functions
859-
860862void showMenuSheet (void )
861863{
862864 UnboundMenuViewController *settingsVC = [[UnboundMenuViewController alloc ] init ];
0 commit comments