From 8d4b602ab8b7a88fe113423504fbc901f9d009c4 Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Wed, 4 Nov 2020 04:38:37 -0700 Subject: [PATCH] Execute completion handler on main queue (#4947) --- .../RNNotificationEventHandler+HandleReplyAction.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ios/Mattermost/RNNotificationEventHandler+HandleReplyAction.m b/ios/Mattermost/RNNotificationEventHandler+HandleReplyAction.m index e06975c75..e73b929cf 100644 --- a/ios/Mattermost/RNNotificationEventHandler+HandleReplyAction.m +++ b/ios/Mattermost/RNNotificationEventHandler+HandleReplyAction.m @@ -102,7 +102,9 @@ NSString *const ReplyActionID = @"REPLY_ACTION"; [[UIApplication sharedApplication] setApplicationIconBadgeNumber:[notifications count]]; }]; - completionHandler(); + dispatch_async(dispatch_get_main_queue(), ^{ + completionHandler(); + }); } - (void) handleReplyFailure:(NSString *)channelId completionHandler:(void (^)(void))completionHandler { @@ -124,7 +126,9 @@ NSString *const ReplyActionID = @"REPLY_ACTION"; }; [notificationCenter sendLocalNotification:notification withId:id]; - completionHandler(); + dispatch_async(dispatch_get_main_queue(), ^{ + completionHandler(); + }); } #pragma mark - Method Swizzling