mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix contacts reminder view
We had a guard that prevented 'called at least once' from ever getting set when contacts access was disabled. // FREEBIE
This commit is contained in:
parent
66ebb7b787
commit
9f06163b76
4 changed files with 12 additions and 10 deletions
|
@ -304,7 +304,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|||
- (void)updateReminderViews
|
||||
{
|
||||
self.archiveReminderView.hidden = self.homeViewMode != HomeViewMode_Archive;
|
||||
self.missingContactsPermissionView.hidden = !self.shouldShowMissingContactsPermissionView;
|
||||
self.missingContactsPermissionView.hidden = !self.contactsManager.isSystemContactsDenied;
|
||||
self.deregisteredView.hidden = !TSAccountManager.sharedInstance.isDeregistered;
|
||||
self.outageView.hidden = !OutageDetection.sharedManager.hasOutage;
|
||||
}
|
||||
|
@ -699,15 +699,6 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|||
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
}
|
||||
|
||||
- (BOOL)shouldShowMissingContactsPermissionView
|
||||
{
|
||||
if (!self.contactsManager.systemContactsHaveBeenRequestedAtLeastOnce) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return !self.contactsManager.isSystemContactsAuthorized;
|
||||
}
|
||||
|
||||
#pragma mark - Table View Data Source
|
||||
|
||||
// Returns YES IFF this value changes.
|
||||
|
|
|
@ -41,6 +41,7 @@ extern NSString *const OWSContactsManagerSignalAccountsDidChangeNotification;
|
|||
|
||||
// Must call `requestSystemContactsOnce` before accessing this method
|
||||
@property (nonatomic, readonly) BOOL isSystemContactsAuthorized;
|
||||
@property (nonatomic, readonly) BOOL isSystemContactsDenied;
|
||||
@property (nonatomic, readonly) BOOL systemContactsHaveBeenRequestedAtLeastOnce;
|
||||
|
||||
@property (nonatomic, readonly) BOOL supportsContactEditing;
|
||||
|
|
|
@ -129,6 +129,11 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification
|
|||
return self.systemContactsFetcher.isAuthorized;
|
||||
}
|
||||
|
||||
- (BOOL)isSystemContactsDenied
|
||||
{
|
||||
return self.systemContactsFetcher.isDenied;
|
||||
}
|
||||
|
||||
- (BOOL)systemContactsHaveBeenRequestedAtLeastOnce
|
||||
{
|
||||
return self.systemContactsFetcher.systemContactsHaveBeenRequestedAtLeastOnce;
|
||||
|
|
|
@ -170,6 +170,11 @@ public class SystemContactsFetcher: NSObject {
|
|||
return self.authorizationStatus == .authorized
|
||||
}
|
||||
|
||||
@objc
|
||||
public var isDenied: Bool {
|
||||
return self.authorizationStatus == .denied
|
||||
}
|
||||
|
||||
@objc
|
||||
public private(set) var systemContactsHaveBeenRequestedAtLeastOnce = false
|
||||
private var hasSetupObservation = false
|
||||
|
|
Loading…
Reference in a new issue