mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-23 06:38:35 +02:00
CWA-209 | added possibility to show address of subaddress instead empty label; added possibility to edit label of subaddress; added setLabel method to subaddress creation store; fixed setLabelSubaddress method in the subaddress_list.dart
This commit is contained in:
@@ -27,6 +27,7 @@ abstract class SubadrressCreationStoreBase with Store {
|
||||
walletService.onWalletChange.listen(_onWalletChanged);
|
||||
}
|
||||
|
||||
@observable
|
||||
SubaddressCreationState state;
|
||||
|
||||
@observable
|
||||
@@ -70,6 +71,20 @@ abstract class SubadrressCreationStoreBase with Store {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> setLabel({int addressIndex, String label}) async {
|
||||
try {
|
||||
state = SubaddressIsCreating();
|
||||
await _subaddressList.setLabelSubaddress(
|
||||
accountIndex: _account.id,
|
||||
addressIndex: addressIndex,
|
||||
label: label
|
||||
);
|
||||
state = SubaddressCreatedSuccessfully();
|
||||
} catch (e) {
|
||||
state = SubaddressCreationFailure(error: e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onWalletChanged(Wallet wallet) async {
|
||||
if (wallet is MoneroWallet) {
|
||||
_account = wallet.account;
|
||||
|
||||
Reference in New Issue
Block a user