Skip to content

Commit

Permalink
Fix locations screen crash and selection bug (#2252)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1203137811378537/1206668692602262/f
https://app.asana.com/0/1203137811378537/1206676963602574/f

**Description**:

There were two issues found on the VPN Locations screen.
1. It crashes on opening (possibly only with specific screen sizes) on
Big Sur
2. The selection state is not cleared from the UI on cancelling
  • Loading branch information
graeme authored Feb 24, 2024
1 parent a0011be commit a06596d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
<Test
Identifier = "EncryptionKeyStoreTests">
</Test>
<Test
Identifier = "ErrorPageTests/testWhenTabWithNoConnectionErrorActivated_reloadTriggered()">
</Test>
<Test
Identifier = "HTTPSUpgradeIntegrationTests">
</Test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ struct VPNLocationView: View {
await model.onViewAppeared()
}
}
.onDisappear {
Task {
await model.onViewDisappered()
}
}
}
.frame(minWidth: 624, maxWidth: .infinity, minHeight: 640, maxHeight: .infinity, alignment: .top)
.frame(width: 624, height: 640, alignment: .top)
}

@ViewBuilder
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 a06596d

Please sign in to comment.