Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #153 from matrix-org/vector_506
Browse files Browse the repository at this point in the history
Should fix - Sync has got stuck while the app was backgrounded
  • Loading branch information
giomfo authored Aug 25, 2016
2 parents 6dac73d + bf09b55 commit a63973b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MatrixKit/Models/Account/MXKAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,9 @@ - (void)pauseInBackgroundTask
[initialServerSyncTimer invalidate];
initialServerSyncTimer = nil;

if (mxSession.state == MXSessionStateSyncInProgress)
if (mxSession.state == MXSessionStateSyncInProgress || mxSession.state == MXSessionStateInitialised || mxSession.state == MXSessionStateStoreDataReady)
{
NSLog(@"[MXKAccount] Pause is delayed at the end of sync (current state %tu)", mxSession.state);
isPauseRequested = YES;
}
}
Expand Down Expand Up @@ -984,6 +985,7 @@ - (void)onMatrixSessionStateChange
// Check if pause has been requested
if (isPauseRequested)
{
NSLog(@"[MXKAccount] Apply the pending pause.");
[self pauseInBackgroundTask];
return;
}
Expand Down

0 comments on commit a63973b

Please # to comment.