check if changes before save context
This commit is contained in:
parent
ff83ed29d4
commit
0be04eac30
1 changed files with 3 additions and 1 deletions
|
|
@ -197,7 +197,9 @@ class PasswordStore {
|
||||||
passwordEntity.synced = true
|
passwordEntity.synced = true
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
if context.hasChanges {
|
||||||
try context.save()
|
try context.save()
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
fatalError("Failed to save: \(error)")
|
fatalError("Failed to save: \(error)")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue