diff --git a/Chronos/App/Onboarding/StorageSetupView.swift b/Chronos/App/Onboarding/StorageSetupView.swift index fdcfbad..742e011 100644 --- a/Chronos/App/Onboarding/StorageSetupView.swift +++ b/Chronos/App/Onboarding/StorageSetupView.swift @@ -59,21 +59,17 @@ struct StorageSetupView: View { .navigationDestination(isPresented: $nextBtnPressed) { PasswordSetupView() } - .confirmationDialog("Backup Exists", isPresented: $showICloudOverwriteConfirmation, titleVisibility: .visible) { - Button("Remove & Continue", role: .destructive, action: { - let cryptoDeleted = swiftDataService.deleteCloudChronosCryptoData() - - if cryptoDeleted { - isICloudEnabled = true - nextBtnPressed = true - } + .confirmationDialog("Vault Exists", isPresented: $showICloudOverwriteConfirmation, titleVisibility: .visible) { + Button("Continue", role: .destructive, action: { + isICloudEnabled = true + nextBtnPressed = true }) Button("Cancel", role: .cancel, action: { self.showICloudOverwriteConfirmation = false }) } message: { - Text("A Chronos backup already exists in iCloud. Are you sure you want to remove all data?") + Text("A vault already exists in iCloud. Are you sure you want to create a new one?") } } } diff --git a/Chronos/Services/SwiftDataService.swift b/Chronos/Services/SwiftDataService.swift index ff1ea14..6128872 100644 --- a/Chronos/Services/SwiftDataService.swift +++ b/Chronos/Services/SwiftDataService.swift @@ -75,13 +75,4 @@ extension SwiftDataService { getCloudModelContainer().deleteAllData() resetModelContainers() } - - func deleteCloudChronosCryptoData() -> Bool { - let container = getCloudModelContainer() - let modelContext = ModelContext(container) - try? modelContext.delete(model: ChronosCrypto.self) - try? modelContext.delete(model: EncryptedToken.self) - try? modelContext.save() - return true - } }