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:
Marvin 2026-03-17 16:30:49 -03:00
parent 7d3122f137
commit 3af91ed8c0
1 changed files with 3 additions and 0 deletions

View File

@ -191,6 +191,9 @@ public class Note implements Serializable {
note.items = parseChecklistItems(itemsJson); note.items = parseChecklistItems(itemsJson);
} }
// Mark as saved so original values are set to the loaded data
note.markAsSaved();
return note; return note;
} }