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 #678 from matrix-org/riot_3337
Browse files Browse the repository at this point in the history
Fix Opening from Notification Bug
  • Loading branch information
ismailgulek authored Jun 11, 2020
2 parents 84a2703 + e610e3b commit 6c4c440
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Bug fix:
* MXKRoomDataSource: Wait for store data ready when finalizing initialization on data source (vector-im/riot-ios/issues/3159).
* MXKLanguagePickerViewController: Fix selected cell reuse issue.
* MXKRoomDataSource: Wait for initial event existence if provided (vector-im/riot-ios/issues/3290).
* MXKRoomDataSource: Convert one-time observers to block variables to avoid releasing (vector-im/riot-ios/issues/3337).

Changes in MatrixKit in 0.12.6 (2020-05-18)
=========================================
Expand Down
6 changes: 2 additions & 4 deletions MatrixKit/Models/Room/MXKRoomDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ + (void)ensureSessionStateForDataSource:(MXKRoomDataSource*)roomDataSource initi
else
{
// wait for session state to be store data ready
id sessionStateObserver = nil;
sessionStateObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionStateDidChangeNotification object:mxSession queue:nil usingBlock:^(NSNotification * _Nonnull note) {
__block id sessionStateObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionStateDidChangeNotification object:mxSession queue:nil usingBlock:^(NSNotification * _Nonnull note) {
if (mxSession.state >= MXSessionStateStoreDataReady)
{
[[NSNotificationCenter defaultCenter] removeObserver:sessionStateObserver];
Expand Down Expand Up @@ -241,8 +240,7 @@ + (void)ensureInitialEventExistenceForDataSource:(MXKRoomDataSource*)roomDataSou
{
// give a chance for the specific event to be existent, for only one sync
// use kMXSessionDidSyncNotification here instead of MXSessionStateRunning, because session does not send this state update if it's already in this state
id syncObserver = nil;
syncObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionDidSyncNotification object:mxSession queue:nil usingBlock:^(NSNotification * _Nonnull note) {
__block id syncObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionDidSyncNotification object:mxSession queue:nil usingBlock:^(NSNotification * _Nonnull note) {
[[NSNotificationCenter defaultCenter] removeObserver:syncObserver];
[self finalizeRoomDataSource:roomDataSource onComplete:onComplete];
}];
Expand Down

0 comments on commit 6c4c440

Please sign in to comment.