Skip to content

Commit

Permalink
bump version, implement auto connect
Browse files Browse the repository at this point in the history
  • Loading branch information
JJTech0130 committed Mar 26, 2024
1 parent 33397d6 commit 7505007
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ValidationRelay.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.jjtech.experiments.ValidationRelay;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -362,7 +362,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = dev.jjtech.experiments.ValidationRelay;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
9 changes: 8 additions & 1 deletion ValidationRelay/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct ContentView: View {
//@State private var registrationCode = "Not Connected"
//@State private var connectionStatusMessage = ""

@State private var wantRelayConnected = false // TODO: Come up with a method to auto connect
@AppStorage("autoConnect") private var wantRelayConnected = false // TODO: Come up with a method to auto connect

@AppStorage("selectedRelay") private var selectedRelay = "Beeper"
@AppStorage("customRelayURL") private var customRelayURL = ""
Expand All @@ -23,6 +23,13 @@ struct ContentView: View {
// relayConnectionManager = RelayConnectionManager(registrationCodeBinding: $registrationCode, connectionStatusMessageBinding: $connectionStatusMessage)
// }

init(relayConnectionManager: RelayConnectionManager) {
self.relayConnectionManager = relayConnectionManager
if wantRelayConnected {
relayConnectionManager.connect(getCurrentRelayURL())
}
}

func getCurrentRelayURL() -> URL {
if selectedRelay == "Custom" {
if let url = URL(string: customRelayURL) {
Expand Down

0 comments on commit 7505007

Please sign in to comment.