From 2edd2b8f811378bf103d827b163e40aa1a28207a Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 6 Oct 2016 10:41:38 -0400 Subject: [PATCH] set launch state correctly // FREEBIE --- Signal/src/AppDelegate.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 078a6dbd9..5269b0938 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -101,10 +101,13 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; [self prepareScreenProtection]; // Avoid blocking app launch by putting all possible DB access in async thread. + UIApplicationState launchState = application.applicationState; [TSAccountManager runIfRegistered:^{ - if (application.applicationState == UIApplicationStateInactive) { + if (launchState == UIApplicationStateInactive) { + DDLogWarn(@"The app was launched from inactive"); [TSSocketManager becomeActiveFromForeground]; - } else if (application.applicationState == UIApplicationStateBackground) { + } else if (launchState == UIApplicationStateBackground) { + DDLogWarn(@"The app was launched from being backgrounded"); [TSSocketManager becomeActiveFromBackgroundExpectMessage:NO]; } else { DDLogWarn(@"The app was launched in an unknown way");