File tree 1 file changed +13
-8
lines changed
ios/MullvadVPN/View controllers/SelectLocation
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ final class LocationDataSource: UITableViewDiffableDataSource<SelectLocationSect
26
26
customLists: LocationDataSourceProtocol
27
27
) {
28
28
self . tableView = tableView
29
+
30
+ #if DEBUG
29
31
self . dataSources. append ( customLists)
32
+ #endif
30
33
self . dataSources. append ( allLocations)
31
34
32
35
let locationCellFactory = LocationCellFactory (
@@ -76,14 +79,16 @@ final class LocationDataSource: UITableViewDiffableDataSource<SelectLocationSect
76
79
. map { LocationCellViewModel ( group: group, location: $0) }
77
80
}
78
81
79
- updateDataSnapshot ( with: list, reloadExisting: !searchString. isEmpty)
80
-
81
- if searchString. isEmpty {
82
- setSelectedRelayLocation ( selectedRelayLocation, animated: false , completion: {
83
- self . scrollToSelectedRelay ( )
84
- } )
85
- } else {
86
- scrollToTop ( animated: false )
82
+ updateDataSnapshot ( with: list, reloadExisting: !searchString. isEmpty) {
83
+ DispatchQueue . main. async {
84
+ if searchString. isEmpty {
85
+ self . setSelectedRelayLocation ( self . selectedRelayLocation, animated: false , completion: {
86
+ self . scrollToSelectedRelay ( )
87
+ } )
88
+ } else {
89
+ self . scrollToTop ( animated: false )
90
+ }
91
+ }
87
92
}
88
93
}
89
94
You can’t perform that action at this time.
0 commit comments