Skip to content

Commit ba00af7

Browse files
author
Jon Petersson
committed
Fix not showing the correct api access method in use on app reinstall
1 parent b469ef6 commit ba00af7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ios/MullvadREST/Transport/AccessMethodIterator.swift

+3-5
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`
40+
// Validating the index of `lastReachableApiAccessCache` after any changes in `AccessMethodRepository`
4141
if let firstIndex = enabledConfigurations.firstIndex(where: { $0.id == self.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)