Rework how the views observe socket state.

// FREEBIE
pull/1/head
Matthew Chen 9 years ago
parent 45b947dc04
commit d3fc5e4ab8

@ -16,6 +16,8 @@ extern NSString *const kNSNotificationName_IsCensorshipCircumventionActiveDidCha
@property (atomic, readonly) BOOL isCensorshipCircumventionActive; @property (atomic, readonly) BOOL isCensorshipCircumventionActive;
@property (nonatomic, readonly) BOOL hasCensoredPhoneNumber;
+ (instancetype)sharedInstance; + (instancetype)sharedInstance;
- (instancetype)init NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE;

@ -234,12 +234,16 @@ NSString *const kNSNotificationName_IsCensorshipCircumventionActiveDidChange =
- (void)registrationStateDidChange:(NSNotification *)notification - (void)registrationStateDidChange:(NSNotification *)notification
{ {
[self updateHasCensoredPhoneNumber]; dispatch_async(dispatch_get_main_queue(), ^{
[self updateHasCensoredPhoneNumber];
});
} }
- (void)localNumberDidChange:(NSNotification *)notification - (void)localNumberDidChange:(NSNotification *)notification
{ {
[self updateHasCensoredPhoneNumber]; dispatch_async(dispatch_get_main_queue(), ^{
[self updateHasCensoredPhoneNumber];
});
} }
#pragma mark - Logging #pragma mark - Logging

Loading…
Cancel
Save