address notification race

pull/2/head
Michael Kirk 6 years ago
parent 8773373611
commit a9ba848ffc

@ -496,10 +496,12 @@ public class NotificationPresenter: NSObject, NotificationsProtocol {
} }
} }
@objc
public func cancelNotifications(threadId: String) { public func cancelNotifications(threadId: String) {
self.adaptee.cancelNotifications(threadId: threadId) self.adaptee.cancelNotifications(threadId: threadId)
} }
@objc
public func clearAllNotifications() { public func clearAllNotifications() {
adaptee.clearAllNotifications() adaptee.clearAllNotifications()
} }

@ -325,6 +325,11 @@ typedef enum : NSUInteger {
return SSKEnvironment.shared.tsAccountManager; return SSKEnvironment.shared.tsAccountManager;
} }
- (OWSNotificationPresenter *)notificationPresenter
{
return AppEnvironment.shared.notificationPresenter;
}
#pragma mark - #pragma mark -
- (void)addNotificationListeners - (void)addNotificationListeners
@ -1187,6 +1192,13 @@ typedef enum : NSUInteger {
{ {
[super viewDidAppear:animated]; [super viewDidAppear:animated];
// We don't present incoming message notifications for the presented
// conversation. But there's a narrow window *while* the conversationVC
// is being presented where a message notification for the not-quite-yet
// presented conversation can be shown. If that happens, dismiss it as soon
// as we enter the conversation.
[self.notificationPresenter cancelNotificationsWithThreadId:self.thread.uniqueId];
// recover status bar when returning from PhotoPicker, which is dark (uses light status bar) // recover status bar when returning from PhotoPicker, which is dark (uses light status bar)
[self setNeedsStatusBarAppearanceUpdate]; [self setNeedsStatusBarAppearanceUpdate];

Loading…
Cancel
Save