fix: instant refresh for hide amounts toggle

This commit is contained in:
Kyle 🐆 2025-10-18 09:27:21 -04:00 committed by Kyle Santiago
parent 2220769b03
commit 4bd622bcfc
4 changed files with 18 additions and 0 deletions

View file

@ -572,6 +572,9 @@ public class TransactionDiagram extends GridPane {
}
String getSatsValue(long amount) {
if(Config.get().isHideAmounts()) {
return "*****";
}
UnitFormat format = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat();
return format.formatSatsValue(amount);
}

View file

@ -48,6 +48,10 @@ public class NewWalletTransactionsEvent {
}
public String getValueAsText(long value) {
if(Config.get().isHideAmounts()) {
return "*****";
}
UnitFormat format = Config.get().getUnitFormat();
if(format == null) {
format = UnitFormat.DOT;

View file

@ -405,6 +405,7 @@ public class PaymentController extends WalletFormController implements Initializ
DecimalFormat df = new DecimalFormat("#.#", unitFormat.getDecimalFormatSymbols());
df.setMaximumFractionDigits(8);
amount.setText(df.format(newValue.getValue(value)));
setFiatAmount(AppServices.getFiatCurrencyExchangeRate(), value);
}
});
@ -923,6 +924,11 @@ public class PaymentController extends WalletFormController implements Initializ
updateOpenWallets(event.getWallets());
}
@Subscribe
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
fiatAmount.refresh(Config.get().getUnitFormat());
}
private static class DnsPaymentService extends Service<Optional<DnsPayment>> {
private final String hrn;

View file

@ -1635,6 +1635,11 @@ public class SendController extends WalletFormController implements Initializabl
}
}
@Subscribe
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
updateTransaction();
}
private class PrivacyAnalysisTooltip extends VBox {
private final List<Label> analysisLabels = new ArrayList<>();