mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-21 13:55:58 +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() {
|
@objc func openWelcomeScreen() {
|
||||||
// Create the welcome screen SwiftUI view
|
// Create the welcome screen SwiftUI view
|
||||||
let welcomeView = WelcomeScreen {
|
let welcomeView = WelcomeScreen(openPlusScreen: openPlusScreen, checkForNetworkIssues: performDeviceToDeviceCheck)
|
||||||
self.openPlusScreen()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create an NSWindow to host the SwiftUI view
|
// Create an NSWindow to host the SwiftUI view
|
||||||
welcomeWindow = NSWindow(
|
welcomeWindow = NSWindow(
|
||||||
|
|||||||
@@ -165,5 +165,5 @@ func copyToClipboard(_ text: String) {
|
|||||||
|
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
WelcomeScreen(openIAP: {})
|
WelcomeScreen(openPlusScreen: {}, checkForNetworkIssues: {})
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,8 @@ struct WelcomeScreen: View {
|
|||||||
@AppStorage(UserDefaultsKeys.plusVersion.rawValue) var isPlusVersion = false
|
@AppStorage(UserDefaultsKeys.plusVersion.rawValue) var isPlusVersion = false
|
||||||
@Environment(\.colorScheme) var colorScheme
|
@Environment(\.colorScheme) var colorScheme
|
||||||
|
|
||||||
let openIAP: () -> Void
|
let openPlusScreen: () -> Void
|
||||||
|
let checkForNetworkIssues: () -> Void
|
||||||
|
|
||||||
@State private var selection: Tabs? = Tabs.receive
|
@State private var selection: Tabs? = Tabs.receive
|
||||||
|
|
||||||
@@ -85,16 +86,19 @@ struct WelcomeScreen: View {
|
|||||||
|
|
||||||
switch selection {
|
switch selection {
|
||||||
case .receive:
|
case .receive:
|
||||||
TutorialView(title: "WelcomeToQuickDrop", text: "UserManualDescription", showsLicense: true, openIAP: openIAP)
|
TutorialView(title: "WelcomeToQuickDrop", text: "UserManualDescription", showsLicense: true, openIAP: openPlusScreen)
|
||||||
|
|
||||||
case .send:
|
case .send:
|
||||||
TutorialView(title: "SendFiles", text: "SendFilesDescription", showsLicense: false, openIAP: openIAP)
|
TutorialView(title: "SendFiles", text: "SendFilesDescription", showsLicense: false, openIAP: openPlusScreen)
|
||||||
|
|
||||||
case .troubleshooting:
|
case .troubleshooting:
|
||||||
TutorialView(title: "Troubleshooting", text: "TroubleshootingDescription", showsLicense: false, openIAP: openIAP)
|
TutorialView(title: "Troubleshooting", text: "TroubleshootingDescription", showsLicense: false, openIAP: openPlusScreen)
|
||||||
|
.onAppear {
|
||||||
|
checkForNetworkIssues()
|
||||||
|
}
|
||||||
|
|
||||||
case .app:
|
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:
|
default:
|
||||||
SettingsView()
|
SettingsView()
|
||||||
@@ -158,5 +162,5 @@ enum Tabs: CaseIterable {
|
|||||||
|
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
WelcomeScreen(openIAP: {})
|
WelcomeScreen(openPlusScreen: {}, checkForNetworkIssues: {})
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user