From 329cc017407e84b20e8f4022f70ef8d595f9dec9 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Fri, 13 Oct 2017 17:07:46 +0200 Subject: [PATCH] Bug Fix - Notification explosion on initial sync Add sanity check: Do not display local notifications during the initial sync. --- Riot/AppDelegate.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 963c104b6..3b8d97459 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -2295,9 +2295,15 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN MXOnNotification notificationListenerBlock = ^(MXEvent *event, MXRoomState *roomState, MXPushRule *rule) { + // Do not display local notification if the app is not running in background. if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground) { - // Do not display local notification if the app is not running in background. + return; + } + + // Do not display local notifications during the initial sync. + if (!account.mxSession.isEventStreamInitialised) + { return; }