Skip to content

Commit

Permalink
source for macOS 1.0.1 (9) and iOS 1.0.1 (9) (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
64bit committed Sep 20, 2024
1 parent f3df529 commit 243ece9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
1 change: 0 additions & 1 deletion upvpn-apple/UpVPN/App/UpVPNApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ struct MenuBarExtraWrapper: View {
case .signedIn:
VStack(spacing: 10) {
HomeCard(tunnelStatus: tunnelViewModel.tunnelObserver.tunnelStatus,
selectedLocation: locationViewModel.selected,
start: {
if let location = locationViewModel.selected {
locationViewModel.addRecent(location: location)
Expand Down
6 changes: 2 additions & 4 deletions upvpn-apple/UpVPN/App/Views/HomeCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import SwiftUI

struct HomeCard: View {
var tunnelStatus: TunnelStatus
var selectedLocation: Location?
var start: () -> Void = {}
var stop: () -> Void = {}

Expand Down Expand Up @@ -60,7 +59,6 @@ struct HomeCard: View {
VStack(spacing: 15) {

HomeCardLocation(
selectedLocation: selectedLocation ?? Location.default,
isDisconnectedOrConnected: tunnelStatus.isDisconnectedOrConnected(),
isDisconnected: tunnelStatus.isDisconnected())

Expand All @@ -79,11 +77,11 @@ struct HomeCard: View {
}

#Preview {
HomeCard(tunnelStatus: TunnelStatus.connected(Location.default, Date.now), selectedLocation: Location.default)
HomeCard(tunnelStatus: TunnelStatus.connected(Location.default, Date.now))
.environmentObject(LocationViewModel(dataRepository: DataRepository.shared, isDisconnected: { return true }))
}

#Preview {
HomeCard(tunnelStatus: TunnelStatus.serverRunning(Location.default), selectedLocation: Location.default)
HomeCard(tunnelStatus: TunnelStatus.serverRunning(Location.default))
.environmentObject(LocationViewModel(dataRepository: DataRepository.shared, isDisconnected: { return true }))
}
11 changes: 9 additions & 2 deletions upvpn-apple/UpVPN/App/Views/HomeCardLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
import SwiftUI

struct HomeCardLocation: View {
var selectedLocation: Location = Location.default
private var selectedLocation: Location {
// hack to always return updated location to get updated estimate
if let foundIdx = self.locationViewModel.locations.firstIndex(of: self.locationViewModel.selected ?? Location.default) {
return self.locationViewModel.locations[foundIdx]
} else {
return Location.default
}
}
var isDisconnectedOrConnected: Bool = false
var isDisconnected: Bool = true

Expand All @@ -24,11 +31,11 @@ struct HomeCardLocation: View {
Circle()
.fill(selectedLocation.warmOrColdColor())
.frame(width: 12, height: 12)
.id(locationViewModel.locationsLastUpdated)
} else {
ProgressView()
.modifier(ScaleEffectModifier())
}

}
.padding()
.cornerRadius(15)
Expand Down
1 change: 0 additions & 1 deletion upvpn-apple/UpVPN/App/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct HomeView: View {
.fill(Color.uSystemGroupedBackground)
.ignoresSafeArea()
HomeCard(tunnelStatus: tunnelViewModel.tunnelObserver.tunnelStatus,
selectedLocation: locationViewModel.selected,
start: {
if let location = locationViewModel.selected {
locationViewModel.addRecent(location: location)
Expand Down
2 changes: 1 addition & 1 deletion upvpn-apple/UpVPN/App/Views/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct LoginView: View {

HStack {
Text("""
By using UpVPN you agree to our [Terms](https://upvpn.app/terms-of-service) and [Privacy Policy](https://upvpn.app/privacy-policy)
By using UpVPN.app you agree to our [Terms](https://upvpn.app/terms-of-service) and [Privacy Policy](https://upvpn.app/privacy-policy)
""")
}
.font(.caption)
Expand Down
2 changes: 1 addition & 1 deletion upvpn-apple/UpVPN/Config/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION_NAME = 1.0.1
VERSION_ID = 8
VERSION_ID = 9
1 change: 0 additions & 1 deletion upvpn-apple/UpVPN/iOS/Views/ResponsiveHomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ struct ResponsiveHomeView: View {
VStack(spacing: 0) {
HStack(spacing: 0) {
HomeCard(tunnelStatus: tunnelViewModel.tunnelObserver.tunnelStatus,
selectedLocation: locationViewModel.selected,
start: {
if let location = locationViewModel.selected {
locationViewModel.addRecent(location: location)
Expand Down

0 comments on commit 243ece9

Please sign in to comment.