mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix a problem with dismissing the update view in some scenarios
This commit is contained in:
parent
78c45db55a
commit
cc3af968f3
@ -522,11 +522,14 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain";
|
||||
navController_.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
}
|
||||
|
||||
hockeyViewController.modalAnimated = YES;
|
||||
|
||||
[parentViewController presentModalViewController:navController_ animated:YES];
|
||||
} else {
|
||||
// if not, we add a subview to the window. A bit hacky but should work in most circumstances.
|
||||
// Also, we don't get a nice animation for free, but hey, this is for beta not production users ;)
|
||||
BWHockeyLog(@"No rootViewController found, using UIWindow-approach: %@", visibleWindow);
|
||||
hockeyViewController.modalAnimated = NO;
|
||||
[visibleWindow addSubview:navController_.view];
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ typedef enum {
|
||||
NSDictionary *cellLayout;
|
||||
|
||||
BOOL modal_;
|
||||
BOOL modalAnimated_;
|
||||
BOOL kvoRegistered_;
|
||||
BOOL showAllVersions_;
|
||||
UIStatusBarStyle statusBarStyle_;
|
||||
@ -59,6 +60,7 @@ typedef enum {
|
||||
|
||||
@property (nonatomic, retain) BWHockeyManager *hockeyManager;
|
||||
@property (nonatomic, readwrite) BOOL modal;
|
||||
@property (nonatomic, readwrite) BOOL modalAnimated;
|
||||
|
||||
- (id)init:(BWHockeyManager *)newHockeyManager modal:(BOOL)newModal;
|
||||
- (id)init;
|
||||
|
@ -50,6 +50,7 @@
|
||||
@synthesize appStoreButtonState = appStoreButtonState_;
|
||||
@synthesize hockeyManager = hockeyManager_;
|
||||
@synthesize modal = modal_;
|
||||
@synthesize modalAnimated = modalAnimated_;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
@ -234,6 +235,7 @@
|
||||
if ((self = [super initWithStyle:UITableViewStylePlain])) {
|
||||
self.hockeyManager = newHockeyManager;
|
||||
self.modal = newModal;
|
||||
self.modalAnimated = YES;
|
||||
self.title = BWHockeyLocalize(@"HockeyUpdateScreenTitle");
|
||||
|
||||
if ([self.hockeyManager shouldShowUserSettings]) {
|
||||
@ -280,7 +282,7 @@
|
||||
}
|
||||
|
||||
// If there is no presenting view controller just remove view
|
||||
if (presentingViewController) {
|
||||
if (presentingViewController && self.modalAnimated) {
|
||||
[presentingViewController dismissModalViewControllerAnimated:YES];
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user