Skip to content

Commit

Permalink
Fix wrong location being selected after cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme committed Feb 23, 2024
1 parent 5537a9d commit c2f6066
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ struct VPNLocationView: View {
await model.onViewAppeared()
}
}
.onDisappear {
Task {
await model.onViewDisappered()
}
}
}
.frame(width: 624, height: 640, alignment: .top)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ final class VPNLocationViewModel: ObservableObject {
await reloadList()
}

func onViewDisappered() async {
selectedLocation = settings.selectedLocation
await reloadList()
}

func onNearestItemSelection() async {
DailyPixel.fire(pixel: .networkProtectionGeoswitchingSetNearest, frequency: .dailyAndCount, includeAppVersionParameter: true)
selectedLocation = .nearest
Expand Down

0 comments on commit c2f6066

Please sign in to comment.