mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
cleanup
remove dispatch_once. It should be safe to call this multiple times. Although in the default use case this makes pretty much no sense, but for the demo app it's nice to have.
This commit is contained in:
parent
42e0882eb8
commit
72c8033119
@ -89,21 +89,17 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut
|
||||
[self performSelector:@selector(authenticateInstallation) withObject:nil afterDelay:0.1];
|
||||
}
|
||||
|
||||
static dispatch_once_t authenticatePredicate;
|
||||
dispatch_once(&authenticatePredicate, ^{
|
||||
|
||||
switch ([[UIApplication sharedApplication] applicationState]) {
|
||||
case UIApplicationStateActive:
|
||||
[self authenticate];
|
||||
break;
|
||||
case UIApplicationStateBackground:
|
||||
case UIApplicationStateInactive:
|
||||
// do nothing, wait for active state
|
||||
break;
|
||||
}
|
||||
|
||||
[self registerObservers];
|
||||
});
|
||||
switch ([[UIApplication sharedApplication] applicationState]) {
|
||||
case UIApplicationStateActive:
|
||||
[self authenticate];
|
||||
break;
|
||||
case UIApplicationStateBackground:
|
||||
case UIApplicationStateInactive:
|
||||
// do nothing, wait for active state
|
||||
break;
|
||||
}
|
||||
|
||||
[self registerObservers];
|
||||
}
|
||||
|
||||
- (void) authenticate {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user