small tweaks

This commit is contained in:
julian 2024-07-04 10:34:45 -06:00 committed by julian-CStack
parent 8fb49ef029
commit 4f40572366
2 changed files with 4 additions and 11 deletions

View file

@ -422,7 +422,7 @@ class _MoreFeaturesDialogState extends ConsumerState<MoreFeaturesDialog> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Reuse addresses by default",
"Reuse receiving address by default",
style: STextStyles.w600_20(context),
),
],

View file

@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
@ -1335,17 +1334,11 @@ mixin ElectrumXInterface<T extends ElectrumXCurrencyInterface>
needsGenerate = txCount > 0 || currentReceiving.derivationIndex < 0;
}
// TODO this in the wrong place
// If reuseAddress is set, don't generate an address by default.
final WalletInfo info = mainDB.isar.walletInfo
.where()
.walletIdEqualTo(walletId)
.findFirstSync()!;
if (info.otherDataJsonString != null) {
final otherData = jsonDecode(info.otherDataJsonString!);
if (otherData[WalletInfoKeys.reuseAddress] as bool? ?? false) {
if (info.otherData[WalletInfoKeys.reuseAddress] as bool? ?? false) {
return;
}
}
if (needsGenerate) {
await generateNewReceivingAddress();