Bug Fix - Notification explosion on initial sync

Add sanity check: Do not display local notifications during the initial sync.
This commit is contained in:
Giom Foret 2017-10-13 17:07:46 +02:00
parent 8ce87e78a8
commit c117ee7531

View file

@ -2295,9 +2295,15 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
MXOnNotification notificationListenerBlock = ^(MXEvent *event, MXRoomState *roomState, MXPushRule *rule) { 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) 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; return;
} }