Merge #1201: gui: TransactionPanel.update() -> update label if tx already exists

fdf01cc095787c5cf947841c1902a22d500b81d7 gui: TransactionPanel.update() -> update label if tx already exists (pythcoiner)

Pull request description:

  close #1174

  labels were not updated if tx already exists

ACKs for top commit:
  edouardparis:
    ACK fdf01cc095787c5cf947841c1902a22d500b81d7

Tree-SHA512: 0143eab573caa9c0db32895da1f2ee732b0ddc1f0455a9b9d0aab245502f336a807cdc44a8a762c1b00962129bce67de3a80e8f833f1265f87b3a4278e2a7585
This commit is contained in:
edouardparis 2024-07-18 15:07:06 +02:00
commit 86a79759e6
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F

View File

@ -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);
}
}