You've already forked hotpocket
BTHLABS-66: Prepping for public release: Take three
I smell a drastic change to auth flow in the Mac app... Let's see if it gets approved this time :D.
This commit is contained in:
@@ -25,11 +25,20 @@
|
||||
|
||||
-(void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.progressLabelTitle = NSLocalizedString(@"Continue to sign out in your browser...", @"Continue to sign out in your browser...");
|
||||
}
|
||||
|
||||
-(void)viewWillAppear {
|
||||
AppDelegate *appDelegate = [[NSApplication sharedApplication] delegate];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAuthFlowDidFinish:) name:@"AuthFlowDidFinish" object:appDelegate.authFlow];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(onAuthFlowDidFinish:)
|
||||
name:@"AuthFlowDidFinish"
|
||||
object:appDelegate.authFlow];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(onAuthFlowDidReceiveAuthParams:)
|
||||
name:@"AuthFlowDidReceiveAuthParams"
|
||||
object:appDelegate.authFlow];
|
||||
|
||||
[self.progressIndicator startAnimation:self];
|
||||
}
|
||||
@@ -54,10 +63,10 @@
|
||||
alert.alertStyle = NSAlertStyleCritical;
|
||||
alert.messageText = NSLocalizedString(@"Oops!", @"Oops!");
|
||||
alert.informativeText = NSLocalizedString(@"HotPocket couldn't complete this operation.", @"HotPocket couldn't complete this operation.");
|
||||
[alert runModal];
|
||||
|
||||
AuthorizationViewController *authorizationViewController = [self.storyboard instantiateControllerWithIdentifier:@"AuthorizationViewController"];
|
||||
[self presentViewController:authorizationViewController animator:[[ReplaceAnimator alloc] init]];
|
||||
[alert beginSheetModalForWindow:self.view.window completionHandler:^(NSModalResponse response) {
|
||||
AuthorizationViewController *authorizationViewController = [self.storyboard instantiateControllerWithIdentifier:@"AuthorizationViewController"];
|
||||
[self presentViewController:authorizationViewController animator:[[ReplaceAnimator alloc] init]];
|
||||
}];
|
||||
} else {
|
||||
MainViewController *mainViewController = [self.storyboard instantiateControllerWithIdentifier:@"MainViewController"];
|
||||
[self presentViewController:mainViewController animator:[[ReplaceAnimator alloc] init]];
|
||||
@@ -65,4 +74,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
-(void)onAuthFlowDidReceiveAuthParams:(NSNotification *)notification {
|
||||
self.progressLabelTitle = NSLocalizedString(@"Processing authorization...", @"Processing authorization...");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user