diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift index 5f721053e..ac7e4e7e5 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift @@ -29,7 +29,6 @@ import Views @Published var appliedSort = LinkedItemSort.newest.rawValue // @AppStorage(UserDefaultKey.lastSelectedLinkedItemFilter.rawValue) // TODO: missing value here? - // TODO: delete this value when needed (logout, clear core data, new app version @AppStorage(UserDefaultKey.lastItemSyncTime.rawValue) var lastItemSyncTime = DateFormatter.formatterISO8601.string(from: Date( timeIntervalSinceReferenceDate: 0 )) diff --git a/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift b/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift index 64d58fb33..1d65dd84e 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift @@ -96,6 +96,11 @@ public final class DataService: ObservableObject { } func resetCoreData() { + UserDefaults.standard.set( + DateFormatter.formatterISO8601.string(from: Date(timeIntervalSinceReferenceDate: 0)), + forKey: UserDefaultKey.lastItemSyncTime.rawValue + ) + clearCoreData() persistentContainer = PersistentContainer.make()