|
|
|
|
@ -17,6 +17,7 @@ struct PadelClubApp: App { |
|
|
|
|
@StateObject var dataStore = DataStore.shared |
|
|
|
|
@State private var registrationError: RegistrationError? = nil |
|
|
|
|
@State private var importObserverViewModel = ImportObserver() |
|
|
|
|
@State private var showDisconnectionAlert: Bool = false |
|
|
|
|
@Environment(\.horizontalSizeClass) var horizontalSizeClass |
|
|
|
|
|
|
|
|
|
@State var requiredVersion: String? = nil |
|
|
|
|
@ -91,6 +92,10 @@ struct PadelClubApp: App { |
|
|
|
|
.accentColor(.master) |
|
|
|
|
.onAppear { |
|
|
|
|
self._checkVersion() |
|
|
|
|
|
|
|
|
|
if ManualPatcher.patchIfPossible(.disconnect) == true { |
|
|
|
|
self.showDisconnectionAlert = true |
|
|
|
|
} |
|
|
|
|
#if DEBUG |
|
|
|
|
print("Running in Debug mode") |
|
|
|
|
#elseif TESTFLIGHT |
|
|
|
|
@ -104,6 +109,9 @@ struct PadelClubApp: App { |
|
|
|
|
self._onAppear() |
|
|
|
|
print(PersistenceController.getModelVersion()) |
|
|
|
|
} |
|
|
|
|
.alert(isPresented: self.$showDisconnectionAlert, content: { |
|
|
|
|
Alert(title: Text("Vous avez été déconnecté. Veuillez vous reconnecter pour récupérer vos données.")) |
|
|
|
|
}) |
|
|
|
|
.task { |
|
|
|
|
|
|
|
|
|
// try? Tips.resetDatastore() |
|
|
|
|
@ -255,6 +263,12 @@ struct DownloadNewVersionView: View { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
struct DisconnectionAlertView: View { |
|
|
|
|
var body: some View { |
|
|
|
|
Text("Vous avez été déconnecté. Veuillez vous reconnecter pour récupérer vos données.").multilineTextAlignment(.center).padding() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#Preview { |
|
|
|
|
DownloadNewVersionView(version: "1.2") |
|
|
|
|
} |
|
|
|
|
|