From f3d31a7256e2712a726f1a8bdaada7332f3b649a Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 14 Mar 2025 20:18:44 -0500 Subject: [PATCH] receipts/add: Skip updating notes if unchanged If the value of the `notes` form field is the same as the current value for the same field of an existing Firefly transaction, we do not need to update it. --- src/routes/receipts.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/receipts.rs b/src/routes/receipts.rs index 43b115c..5285fa0 100644 --- a/src/routes/receipts.rs +++ b/src/routes/receipts.rs @@ -128,8 +128,12 @@ pub async fn add_receipt( needs_update = true; } if !data.notes.is_empty() { - split.notes = Some(data.notes.clone()); - needs_update = true; + if let Some(notes) = split.notes.as_deref() { + if notes != data.notes.as_str() { + split.notes = Some(data.notes.clone()); + needs_update = true; + } + } } } else { debug!("Transaction {} has no splits", id);