diff --git a/LokiPushNotificationService/NotificationServiceExtension.swift b/LokiPushNotificationService/NotificationServiceExtension.swift index 604c91a19..f5aa06a9e 100644 --- a/LokiPushNotificationService/NotificationServiceExtension.swift +++ b/LokiPushNotificationService/NotificationServiceExtension.swift @@ -16,9 +16,9 @@ final class NotificationServiceExtension : UNNotificationServiceExtension { self.contentHandler = contentHandler notificationContent = (request.content.mutableCopy() as? UNMutableNotificationContent) - // The code using DispatchQueue.main.async { self.setUpIfNecessary(){ Modify the notification content } } will somehow cause a freezing when the second PN comes + // The code using DispatchQueue.main.async { self.setUpIfNecessary() { Modify the notification content } } will somehow cause a freeze when a second PN comes - DispatchQueue.main.sync { self.setUpIfNecessary(){} } + DispatchQueue.main.sync { self.setUpIfNecessary() {} } AppReadiness.runNowOrWhenAppDidBecomeReady { if let notificationContent = self.notificationContent { diff --git a/Signal/src/Loki/View Controllers/HomeVC.swift b/Signal/src/Loki/View Controllers/HomeVC.swift index 5031675a3..39f913d70 100644 --- a/Signal/src/Loki/View Controllers/HomeVC.swift +++ b/Signal/src/Loki/View Controllers/HomeVC.swift @@ -212,7 +212,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol isObservingDatabase = isViewVisible && CurrentAppContext().isAppForegroundAndActive() } - private func updateThreadMapping() { + private func updateYDBThreadMapping() { uiDatabaseConnection.beginLongLivedReadTransaction() uiDatabaseConnection.read { transaction in self.threads.update(with: transaction) @@ -221,7 +221,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol private func reload() { AssertIsOnMainThread() - updateThreadMapping() + updateYDBThreadMapping() threadViewModelCache.removeAll() tableView.reloadData() emptyStateView.isHidden = (threadCount != 0) @@ -253,7 +253,6 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol } } } - var sectionChanges = NSArray() var rowChanges = NSArray() ext.getSectionChanges(§ionChanges, rowChanges: &rowChanges, for: notifications, with: threads) @@ -280,7 +279,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol @objc private func handleApplicationDidBecomeActiveNotification(_ notification: Notification) { updateIsObservingDatabase() - updateThreadMapping() + updateYDBThreadMapping() } @objc private func handleApplicationWillResignActiveNotification(_ notification: Notification) {