mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-31 23:47:01 +00:00
don't register twice
This commit is contained in:
parent
ebbe6dc0af
commit
e3dcfa629f
@ -462,14 +462,16 @@ static NSString* const kBITAuthenticatorLastAuthenticatedVersionKey = @"BITAuthe
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void) registerObservers {
|
- (void) registerObservers {
|
||||||
__weak typeof(self) weakSelf = self;
|
if(nil == _appDidBecomeActiveObserver) {
|
||||||
_appDidBecomeActiveObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
|
__weak typeof(self) weakSelf = self;
|
||||||
object:nil
|
_appDidBecomeActiveObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
|
||||||
queue:NSOperationQueue.mainQueue
|
object:nil
|
||||||
usingBlock:^(NSNotification *note) {
|
queue:NSOperationQueue.mainQueue
|
||||||
typeof(self) strongSelf = weakSelf;
|
usingBlock:^(NSNotification *note) {
|
||||||
[strongSelf applicationDidBecomeActive:note];
|
typeof(self) strongSelf = weakSelf;
|
||||||
}];
|
[strongSelf applicationDidBecomeActive:note];
|
||||||
|
}];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) unregisterObservers {
|
- (void) unregisterObservers {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user