From fdf01cc095787c5cf947841c1902a22d500b81d7 Mon Sep 17 00:00:00 2001 From: pythcoiner Date: Thu, 18 Jul 2024 14:33:46 +0200 Subject: [PATCH] gui: TransactionPanel.update() -> update label if tx already exists --- gui/src/app/state/transactions.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gui/src/app/state/transactions.rs b/gui/src/app/state/transactions.rs index 30d5dec4..aa1a62d2 100644 --- a/gui/src/app/state/transactions.rs +++ b/gui/src/app/state/transactions.rs @@ -99,7 +99,9 @@ impl State for TransactionsPanel { Ok(txs) => { self.warning = None; for tx in txs { - if !self.txs.iter().any(|other| other.tx == tx.tx) { + if let Some(t) = self.txs.iter_mut().find(|other| other.tx == tx.tx) { + t.labels = tx.labels; + } else { self.txs.push(tx); } }