[skip ci] Merge branch 'main' of https://github.com/cake-tech/cake_wallet into mweb

This commit is contained in:
Matthew Fosse 2024-09-18 10:27:43 -07:00
commit 34d5d96cc7
3 changed files with 18 additions and 10 deletions
cw_bitcoin/lib
lib/src/screens/dashboard/widgets

View file

@ -76,8 +76,13 @@ abstract class ElectrumTransactionHistoryBase
final val = entry.value;
if (val is Map<String, dynamic>) {
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
_update(tx);
// removing transactions with invalid date
if (val['date'] == 1168650000) {
transactions.remove(entry.key);
} else {
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
_update(tx);
}
}
});

View file

@ -1629,7 +1629,7 @@ abstract class ElectrumWalletBase
}
if (height != null) {
if (time == null) {
if (time == null && height > 0) {
time = (getDateByBitcoinHeight(height).millisecondsSinceEpoch / 1000).round();
}

View file

@ -97,7 +97,15 @@ class MenuWidgetState extends State<MenuWidget> {
@override
Widget build(BuildContext context) {
final itemCount = SettingActions.all.length;
List<SettingActions> items = SettingActions.all;
if (!widget.dashboardViewModel.hasSilentPayments) {
items.removeWhere((element) => element.name(context) == S.of(context).silent_payments_settings);
}
// if (!widget.dashboardViewModel.hasMweb) {
// itemCount--;
// items.removeWhere((element) => element.name(context) == S.of(context).litecoin_mweb_settings);
// }
int itemCount = items.length;
moneroIcon = Image.asset('assets/images/monero_menu.png',
color: Theme.of(context).extension<CakeMenuTheme>()!.iconColor);
@ -181,12 +189,7 @@ class MenuWidgetState extends State<MenuWidget> {
index--;
final item = SettingActions.all[index];
if (!widget.dashboardViewModel.hasSilentPayments &&
item.name(context) == S.of(context).silent_payments_settings) {
return Container();
}
final item = items[index];
if (!widget.dashboardViewModel.hasMweb &&
item.name(context) == S.current.litecoin_mweb_settings) {