Fix: Properly initialize original values when loading notes from storage
When deserializing a Note from JSON, the constructor was called first which initialized original tracking with empty values. Then the JSON fields were parsed and set, but hasChanges() would always return true because it compared the loaded content against empty originals. Solution: Call markAsSaved() after parsing in fromJson() to update the original tracking with the actual loaded data.
This commit is contained in:
parent
7d3122f137
commit
3af91ed8c0
|
|
@ -191,6 +191,9 @@ public class Note implements Serializable {
|
|||
note.items = parseChecklistItems(itemsJson);
|
||||
}
|
||||
|
||||
// Mark as saved so original values are set to the loaded data
|
||||
note.markAsSaved();
|
||||
|
||||
return note;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue