mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Network check if troubleshooting is opened
This commit is contained in:
1 parent
3522a64955
commit
0115a6453e
3 files changed
+12
-10
No files matched your search
@@ -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(
|
||||
|
||||
@@ -165,5 +165,5 @@ func copyToClipboard(_ text: String) {
|
||||
|
||||
|
||||
#Preview {
|
||||
WelcomeScreen(openIAP: {})
|
||||
WelcomeScreen(openPlusScreen: {}, checkForNetworkIssues: {})
|
||||
}
|
||||
@@ -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: {})
|
||||
}
|
||||
Reference in new issue
Block a user