diff --git a/Signal/src/ViewControllers/HomeViewController.m b/Signal/src/ViewControllers/HomeViewController.m index 543df0906..47dc05d13 100644 --- a/Signal/src/ViewControllers/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeViewController.m @@ -931,10 +931,12 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState }; DDLogVerbose(@"%@ %s", self.logTag, __PRETTY_FUNCTION__); - // External database modifications can't be converted into incremental updates, - // so rebuild everything. This is expensive and usually isn't necessary, but - // there's no alternative. - [self resetMappings]; + if (self.shouldObserveDBModifications) { + // External database modifications can't be converted into incremental updates, + // so rebuild everything. This is expensive and usually isn't necessary, but + // there's no alternative. + [self resetMappings]; + } } - (void)yapDatabaseModified:(NSNotification *)notification diff --git a/SignalMessaging/Views/ThreadViewHelper.m b/SignalMessaging/Views/ThreadViewHelper.m index 878f1f6b7..b12c7b575 100644 --- a/SignalMessaging/Views/ThreadViewHelper.m +++ b/SignalMessaging/Views/ThreadViewHelper.m @@ -129,16 +129,18 @@ NS_ASSUME_NONNULL_BEGIN DDLogVerbose(@"%@ %s", self.logTag, __PRETTY_FUNCTION__); - // External database modifications can't be converted into incremental updates, - // so rebuild everything. This is expensive and usually isn't necessary, but - // there's no alternative. - [self.uiDatabaseConnection beginLongLivedReadTransaction]; - [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { - [self.threadMappings updateWithTransaction:transaction]; - }]; - - [self updateThreads]; - [self.delegate threadListDidChange]; + if (self.shouldObserveDBModifications) { + // External database modifications can't be converted into incremental updates, + // so rebuild everything. This is expensive and usually isn't necessary, but + // there's no alternative. + [self.uiDatabaseConnection beginLongLivedReadTransaction]; + [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { + [self.threadMappings updateWithTransaction:transaction]; + }]; + + [self updateThreads]; + [self.delegate threadListDidChange]; + } } - (void)yapDatabaseModified:(NSNotification *)notification