mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge branch 'charlesmchen/invalidateMessageAdapterCache'
This commit is contained in:
commit
f6f5d3d455
1 changed files with 4 additions and 0 deletions
|
@ -561,6 +561,8 @@ typedef enum : NSUInteger {
|
|||
// or on another device.
|
||||
[self hideInputIfNeeded];
|
||||
|
||||
self.messageAdapterCache = [[NSCache alloc] init];
|
||||
|
||||
// We need to `beginLongLivedReadTransaction` before we update our
|
||||
// mapping in order to jump to the most recent commit.
|
||||
[self.uiDatabaseConnection beginLongLivedReadTransaction];
|
||||
|
@ -3306,6 +3308,7 @@ typedef enum : NSUInteger {
|
|||
[self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]];
|
||||
|
||||
YapCollectionKey *collectionKey = rowChange.collectionKey;
|
||||
OWSAssert(collectionKey.key.length > 0);
|
||||
if (collectionKey.key) {
|
||||
[self.messageAdapterCache removeObjectForKey:collectionKey.key];
|
||||
}
|
||||
|
@ -3329,6 +3332,7 @@ typedef enum : NSUInteger {
|
|||
}
|
||||
case YapDatabaseViewChangeUpdate: {
|
||||
YapCollectionKey *collectionKey = rowChange.collectionKey;
|
||||
OWSAssert(collectionKey.key.length > 0);
|
||||
if (collectionKey.key) {
|
||||
[self.messageAdapterCache removeObjectForKey:collectionKey.key];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue