diff --git a/Natives/AccountListViewController.m b/Natives/AccountListViewController.m index c3c63027..1628f46f 100644 --- a/Natives/AccountListViewController.m +++ b/Natives/AccountListViewController.m @@ -95,7 +95,9 @@ [self addActivityIndicatorTo:cell]; id callback = ^(id status, BOOL success) { - [self callbackMicrosoftAuth:status success:success forCell:cell]; + dispatch_async(dispatch_get_main_queue(), ^(){ + [self callbackMicrosoftAuth:status success:success forCell:cell]; + }); }; [[BaseAuthenticator loadSavedName:self.accountList[indexPath.row][@"username"]] refreshTokenWithCallback:callback]; } @@ -210,14 +212,18 @@ NSDictionary *queryItems = [self parseQueryItems:callbackURL.absoluteString]; if (queryItems[@"code"]) { - self.modalInPresentation = YES; - self.tableView.userInteractionEnabled = NO; - [self addActivityIndicatorTo:sender]; + dispatch_async(dispatch_get_main_queue(), ^(){ + self.modalInPresentation = YES; + self.tableView.userInteractionEnabled = NO; + [self addActivityIndicatorTo:sender]; + }); id callback = ^(id status, BOOL success) { if ([status isKindOfClass:NSString.class] && [status isEqualToString:@"DEMO"] && success) { showDialog(localize(@"login.warn.title.demomode", nil), localize(@"login.warn.message.demomode", nil)); } - [self callbackMicrosoftAuth:status success:success forCell:sender]; + dispatch_async(dispatch_get_main_queue(), ^(){ + [self callbackMicrosoftAuth:status success:success forCell:sender]; + }); }; [[[MicrosoftAuthenticator alloc] initWithInput:queryItems[@"code"]] loginWithCallback:callback]; } else { diff --git a/Natives/main.m b/Natives/main.m index efdf5665..fd396471 100644 --- a/Natives/main.m +++ b/Natives/main.m @@ -128,6 +128,11 @@ void init_logDeviceAndVer(char *argument) { } void init_redirectStdio() { + if (getenv("POJAV_LOG_TO_CONSOLE") != NULL) { + NSLog(@"[Pre-init] POJAV_LOG_TO_CONSOLE is set, not logging to latestlog.txt"); + return; + } + NSLog(@"[Pre-init] Starting logging STDIO to latestlog.txt\n"); NSString *home = @(getenv("POJAV_HOME"));