add a reset core data option in manage account menu
This commit is contained in:
@ -37,6 +37,12 @@ struct ManageAccountView: View {
|
||||
},
|
||||
label: { Text("Delete Account") }
|
||||
)
|
||||
Button(
|
||||
action: {
|
||||
dataService.resetCoreData()
|
||||
},
|
||||
label: { Text("Reset Data Cache") }
|
||||
)
|
||||
.alert(isPresented: $showDeleteAccountConfirmation) {
|
||||
Alert(
|
||||
title: Text("Are you sure you want to delete your account? This action can't be undone."),
|
||||
|
||||
@ -95,7 +95,7 @@ public final class DataService: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func resetCoreData() {
|
||||
public func resetCoreData() {
|
||||
UserDefaults.standard.set(
|
||||
DateFormatter.formatterISO8601.string(from: Date(timeIntervalSinceReferenceDate: 0)),
|
||||
forKey: UserDefaultKey.lastItemSyncTime.rawValue
|
||||
|
||||
Reference in New Issue
Block a user