Network check if troubleshooting is opened

This commit is contained in:
Leon Böttger committed 2025-05-16 11:39:44 +02:00
1 parent 3522a64955
commit 0115a6453e
3 files changed
+12 -10

No files matched your search

+1 -3
View File
@@ -160,9 +160,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
@objc func openWelcomeScreen() {
// Create the welcome screen SwiftUI view
let welcomeView = WelcomeScreen {
self.openPlusScreen()
}
let welcomeView = WelcomeScreen(openPlusScreen: openPlusScreen, checkForNetworkIssues: performDeviceToDeviceCheck)
// Create an NSWindow to host the SwiftUI view
welcomeWindow = NSWindow(
+1 -1
View File
@@ -165,5 +165,5 @@ func copyToClipboard(_ text: String) {
#Preview {
WelcomeScreen(openIAP: {})
WelcomeScreen(openPlusScreen: {}, checkForNetworkIssues: {})
}
+10 -6
View File
@@ -13,7 +13,8 @@ struct WelcomeScreen: View {
@AppStorage(UserDefaultsKeys.plusVersion.rawValue) var isPlusVersion = false
@Environment(\.colorScheme) var colorScheme
let openIAP: () -> Void
let openPlusScreen: () -> Void
let checkForNetworkIssues: () -> Void
@State private var selection: Tabs? = Tabs.receive
@@ -85,16 +86,19 @@ struct WelcomeScreen: View {
switch selection {
case .receive:
TutorialView(title: "WelcomeToQuickDrop", text: "UserManualDescription", showsLicense: true, openIAP: openIAP)
TutorialView(title: "WelcomeToQuickDrop", text: "UserManualDescription", showsLicense: true, openIAP: openPlusScreen)
case .send:
TutorialView(title: "SendFiles", text: "SendFilesDescription", showsLicense: false, openIAP: openIAP)
TutorialView(title: "SendFiles", text: "SendFilesDescription", showsLicense: false, openIAP: openPlusScreen)
case .troubleshooting:
TutorialView(title: "Troubleshooting", text: "TroubleshootingDescription", showsLicense: false, openIAP: openIAP)
TutorialView(title: "Troubleshooting", text: "TroubleshootingDescription", showsLicense: false, openIAP: openPlusScreen)
.onAppear {
checkForNetworkIssues()
}
case .app:
TutorialView(title: "AndroidApp", text: "AndroidAppDescription", showsLicense: false, showsBetaJoinButton: true, openIAP: openIAP)
TutorialView(title: "AndroidApp", text: "AndroidAppDescription", showsLicense: false, showsBetaJoinButton: true, openIAP: openPlusScreen)
default:
SettingsView()
@@ -158,5 +162,5 @@ enum Tabs: CaseIterable {
#Preview {
WelcomeScreen(openIAP: {})
WelcomeScreen(openPlusScreen: {}, checkForNetworkIssues: {})
}