diff options
| author | Jon Petersson <jon.petersson@kvadrat.se> | 2024-03-20 11:52:05 +0100 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2024-03-28 13:22:54 +0100 |
| commit | a1fcb52d7d123c5716727be37d92987f5af609d4 (patch) | |
| tree | e6c705769e98d780b85d5a1993d8ece23c3e360a | |
| parent | 679d6d19333b3a164cb37acab877f329c1a822b1 (diff) | |
| download | mullvadvpn-a1fcb52d7d123c5716727be37d92987f5af609d4.tar.xz mullvadvpn-a1fcb52d7d123c5716727be37d92987f5af609d4.zip | |
Queue all updates to snapshot in LocationDataSource asynchronously
| -rw-r--r-- | ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift index c8c626320b..d237ef1d15 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift @@ -85,14 +85,12 @@ final class LocationDataSource: UITableViewDiffableDataSource<LocationSection, L return } - DispatchQueue.main.async { - if searchString.isEmpty { - self.setSelectedItem(self.selectedItem, animated: false, completion: { - self.scrollToSelectedRelay() - }) - } else { - self.scrollToTop(animated: false) - } + if searchString.isEmpty { + self.setSelectedItem(self.selectedItem, animated: false, completion: { + self.scrollToSelectedRelay() + }) + } else { + self.scrollToTop(animated: false) } } } @@ -134,7 +132,9 @@ final class LocationDataSource: UITableViewDiffableDataSource<LocationSection, L } } - apply(snapshot, animatingDifferences: animated, completion: completion) + DispatchQueue.main.async { + self.apply(snapshot, animatingDifferences: animated, completion: completion) + } } private func registerClasses() { |
