recents_category_drag_drop

fix a refresh issue / crash after updating the room order.
This commit is contained in:
yannick
2015-12-14 11:08:57 +01:00
parent 513a54f7a0
commit 644996aa1e
2 changed files with 18 additions and 20 deletions
+18 -18
View File
@@ -98,13 +98,8 @@
{
dispatch_async(dispatch_get_main_queue(), ^{
if (!self.movingCellIndexPath)
{
[self refreshRoomsSections];
// And inform the delegate about the update
[self.delegate dataSource:self didCellChange:nil];
}
[self refreshRoomsSectionsAndReload];
});
}
@@ -114,18 +109,23 @@
}
}
- (void)refreshRoomsSectionsAndReload
{
if (!self.movingCellIndexPath)
{
[self refreshRoomsSections];
// And inform the delegate about the update
[self.delegate dataSource:self didCellChange:nil];
}
}
- (void)didMXSessionInviteRoomUpdate:(NSNotification *)notif
{
MXSession *mxSession = notif.object;
if (mxSession == self.mxSession)
{
if (!self.movingCellIndexPath)
{
[self refreshRoomsSections];
// And inform the delegate about the update
[self.delegate dataSource:self didCellChange:nil];
}
[self refreshRoomsSectionsAndReload];
}
}
@@ -631,24 +631,24 @@
NSLog(@"[RecentsDataSource] move is done");
[self dataSource:self didCellChange:nil];
if (moveSuccess)
{
moveSuccess();
}
[self refreshRoomsSectionsAndReload];
} failure:^(NSError *error) {
NSLog(@"[RecentsDataSource] Failed to update the tag %@ of room (%@) failed: %@", dstRoomTag, room.state.roomId, error);
[self dataSource:self didCellChange:nil];
if (moveFailure)
{
moveFailure(error);
}
[self refreshRoomsSectionsAndReload];
// Notify MatrixKit user
[[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error];
}];