summaryrefslogtreecommitdiff
path: root/DomainDig/CloudSyncService.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-25 00:41:34 -0500
committerChristian Cleberg <[email protected]>2026-04-25 00:41:34 -0500
commit535bb0ff0f64d57be1074e33ceb42f598f80205b (patch)
tree7e8cf8c86c226c1994555b121218484c05a5bdd4 /DomainDig/CloudSyncService.swift
parent1715e59287a7b48b29ed8cbf2cd45fcc92ec3126 (diff)
downloaddomain-dig-535bb0ff0f64d57be1074e33ceb42f598f80205b.tar.gz
domain-dig-535bb0ff0f64d57be1074e33ceb42f598f80205b.tar.bz2
domain-dig-535bb0ff0f64d57be1074e33ceb42f598f80205b.zip
DomainDig v4.1.0: Add a full local data reset flow in Data Management
- add a destructive Delete All Data action with confirmation, progress, success, and failure handling - centralize wipe behavior in DataResetService instead of scattering delete logic in views - clear local persistence, temp/export files, integration secrets, notifications, caches, and in-memory app state - reset sync, purchase, and integration services after wipe so the app returns to a clean first-launch state Polish batch and empty-state UX - present the batch sweep summary after manual bulk searches complete, not only from Watchlist - align the Workflows empty state styling with other empty states by removing the extra background card treatment Bump the project version from 4.0.0 to 4.1.0
Diffstat (limited to 'DomainDig/CloudSyncService.swift')
-rw-r--r--DomainDig/CloudSyncService.swift14
1 files changed, 14 insertions, 0 deletions
diff --git a/DomainDig/CloudSyncService.swift b/DomainDig/CloudSyncService.swift
index 1cf41d9..2cb4cfe 100644
--- a/DomainDig/CloudSyncService.swift
+++ b/DomainDig/CloudSyncService.swift
@@ -321,6 +321,20 @@ final class CloudSyncService {
}
}
+ func resetLocalStateAfterWipe() {
+ scheduledSyncTask?.cancel()
+ scheduledSyncTask = nil
+ syncTask?.cancel()
+ syncTask = nil
+
+ let syncEnabled = defaults.bool(forKey: StorageKey.isEnabled)
+ isEnabled = syncEnabled
+ status = CloudSyncStatus(rawValue: defaults.string(forKey: StorageKey.status) ?? "") ?? (syncEnabled ? .synced : .disabled)
+ lastSyncDate = defaults.object(forKey: StorageKey.lastSyncDate) as? Date
+ lastErrorMessage = defaults.string(forKey: StorageKey.lastErrorMessage)
+ detailMessage = defaults.string(forKey: StorageKey.detailMessage) ?? "DomainDig stores synced data in your private iCloud account."
+ }
+
func acceptShare(metadata: CKShare.Metadata) async throws {
guard let container = cloudKitContainer() else {
throw CloudSyncRuntimeError.missingEntitlement