Only show contact nag if we've denied contact access

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent bae0e294de
commit 01e1d10c30

@ -550,7 +550,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
- (BOOL)shouldShowMissingContactsPermissionView
{
if ([TSContactThread numberOfKeysInCollection] == 0) {
if (!self.contactsManager.systemContactsHaveBeenRequestedAtLeastOnce) {
return NO;
}

@ -61,6 +61,7 @@ extern NSString *const OWSContactsManagerSignalAccountsDidChangeNotification;
// Must call `requestSystemContactsOnce` before accessing this method
@property (nonatomic, readonly) BOOL isSystemContactsAuthorized;
@property (nonatomic, readonly) BOOL systemContactsHaveBeenRequestedAtLeastOnce;
@property (nonatomic, readonly) BOOL supportsContactEditing;

@ -108,6 +108,11 @@ NSString *const kTSStorageManager_lastKnownContactRecipientIds = @"lastKnownCont
return self.systemContactsFetcher.isAuthorized;
}
- (BOOL)systemContactsHaveBeenRequestedAtLeastOnce
{
return self.systemContactsFetcher.systemContactsHaveBeenRequestedAtLeastOnce;
}
- (BOOL)supportsContactEditing
{
return self.systemContactsFetcher.supportsContactEditing;

@ -342,7 +342,7 @@ class SystemContactsFetcher: NSObject {
return self.authorizationStatus == .authorized
}
private var systemContactsHaveBeenRequestedAtLeastOnce = false
private(set) var systemContactsHaveBeenRequestedAtLeastOnce = false
private var hasSetupObservation = false
override init() {

Loading…
Cancel
Save