mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
fix: instant refresh for hide amounts toggle
This commit is contained in:
parent
2220769b03
commit
4bd622bcfc
4 changed files with 18 additions and 0 deletions
|
|
@ -572,6 +572,9 @@ public class TransactionDiagram extends GridPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
String getSatsValue(long amount) {
|
String getSatsValue(long amount) {
|
||||||
|
if(Config.get().isHideAmounts()) {
|
||||||
|
return "*****";
|
||||||
|
}
|
||||||
UnitFormat format = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat();
|
UnitFormat format = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat();
|
||||||
return format.formatSatsValue(amount);
|
return format.formatSatsValue(amount);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,10 @@ public class NewWalletTransactionsEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValueAsText(long value) {
|
public String getValueAsText(long value) {
|
||||||
|
if(Config.get().isHideAmounts()) {
|
||||||
|
return "*****";
|
||||||
|
}
|
||||||
|
|
||||||
UnitFormat format = Config.get().getUnitFormat();
|
UnitFormat format = Config.get().getUnitFormat();
|
||||||
if(format == null) {
|
if(format == null) {
|
||||||
format = UnitFormat.DOT;
|
format = UnitFormat.DOT;
|
||||||
|
|
|
||||||
|
|
@ -405,6 +405,7 @@ public class PaymentController extends WalletFormController implements Initializ
|
||||||
DecimalFormat df = new DecimalFormat("#.#", unitFormat.getDecimalFormatSymbols());
|
DecimalFormat df = new DecimalFormat("#.#", unitFormat.getDecimalFormatSymbols());
|
||||||
df.setMaximumFractionDigits(8);
|
df.setMaximumFractionDigits(8);
|
||||||
amount.setText(df.format(newValue.getValue(value)));
|
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());
|
updateOpenWallets(event.getWallets());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
fiatAmount.refresh(Config.get().getUnitFormat());
|
||||||
|
}
|
||||||
|
|
||||||
private static class DnsPaymentService extends Service<Optional<DnsPayment>> {
|
private static class DnsPaymentService extends Service<Optional<DnsPayment>> {
|
||||||
private final String hrn;
|
private final String hrn;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1635,6 +1635,11 @@ public class SendController extends WalletFormController implements Initializabl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
updateTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
private class PrivacyAnalysisTooltip extends VBox {
|
private class PrivacyAnalysisTooltip extends VBox {
|
||||||
private final List<Label> analysisLabels = new ArrayList<>();
|
private final List<Label> analysisLabels = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue