Skip to content

Commit baf5414

Browse files
committed
Merge branch 'api-access-method-does-not-show-show-the-correct-method-ios-563'
2 parents aa54d78 + bfb83c2 commit baf5414

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ios/MullvadREST/Transport/AccessMethodIterator.swift

+4-6
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ class AccessMethodIterator {
3737
}
3838

3939
private func refreshCacheIfNeeded() {
40-
/// Validating the index of `lastReachableApiAccessCache` after any changes in `AccessMethodRepository`
41-
if let firstIndex = enabledConfigurations.firstIndex(where: { $0.id == self.lastReachableApiAccessId }) {
40+
// Validating the index of `lastReachableApiAccessCache` after any changes in `AccessMethodRepository`
41+
if let firstIndex = enabledConfigurations.firstIndex(where: { $0.id == lastReachableApiAccessId }) {
4242
index = firstIndex
43-
} else {
44-
/// When `firstIndex` is `nil`, that means the current configuration is not valid anymore
45-
/// Invalidating cache by replacing the `current` to the next enabled access method
46-
dataSource.saveLastReachable(pick())
4743
}
44+
45+
dataSource.saveLastReachable(pick())
4846
}
4947

5048
func rotate() {

0 commit comments

Comments
 (0)