set launch state correctly

// FREEBIE
pull/1/head
Michael Kirk 9 years ago
parent a28fea8384
commit 2edd2b8f81

@ -101,10 +101,13 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
[self prepareScreenProtection]; [self prepareScreenProtection];
// Avoid blocking app launch by putting all possible DB access in async thread. // Avoid blocking app launch by putting all possible DB access in async thread.
UIApplicationState launchState = application.applicationState;
[TSAccountManager runIfRegistered:^{ [TSAccountManager runIfRegistered:^{
if (application.applicationState == UIApplicationStateInactive) { if (launchState == UIApplicationStateInactive) {
DDLogWarn(@"The app was launched from inactive");
[TSSocketManager becomeActiveFromForeground]; [TSSocketManager becomeActiveFromForeground];
} else if (application.applicationState == UIApplicationStateBackground) { } else if (launchState == UIApplicationStateBackground) {
DDLogWarn(@"The app was launched from being backgrounded");
[TSSocketManager becomeActiveFromBackgroundExpectMessage:NO]; [TSSocketManager becomeActiveFromBackgroundExpectMessage:NO];
} else { } else {
DDLogWarn(@"The app was launched in an unknown way"); DDLogWarn(@"The app was launched in an unknown way");

Loading…
Cancel
Save