From 62f55ae8f51d6697f658c38e541dd055b392ec41 Mon Sep 17 00:00:00 2001 From: David Adegoke <64401859+Blazebrain@users.noreply.github.com> Date: Tue, 8 Oct 2024 01:07:27 +0100 Subject: [PATCH] Allow Wallet Group Names to be the same as Wallet Names (#1730) * fix: Issues with imaging * fix: Allow group names to be the same as wallet names * fix: Bug with wallet grouping when a wallet is minimized * fix: Bug with wallet grouping when a wallet is minimized --- lib/di.dart | 6 +++++- lib/src/screens/wallet/wallet_edit_page.dart | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/di.dart b/lib/di.dart index 5e5417b34..0008ad8fd 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -378,7 +378,11 @@ Future setup({ getIt.registerFactory(() => NewWalletTypeViewModel(_walletInfoSource)); getIt.registerFactory( - () => WalletManager(_walletInfoSource, getIt.get()), + () { + final instance = WalletManager(_walletInfoSource, getIt.get()); + instance.updateWalletGroups(); + return instance; + }, ); getIt.registerFactoryParam( diff --git a/lib/src/screens/wallet/wallet_edit_page.dart b/lib/src/screens/wallet/wallet_edit_page.dart index 9515e58c3..340091a1e 100644 --- a/lib/src/screens/wallet/wallet_edit_page.dart +++ b/lib/src/screens/wallet/wallet_edit_page.dart @@ -18,7 +18,6 @@ import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; - class WalletEditPage extends BasePage { WalletEditPage({ required this.pageArguments, @@ -86,8 +85,9 @@ class WalletEditPage extends BasePage { child: LoadingPrimaryButton( onPressed: () async { if (_formKey.currentState?.validate() ?? false) { - if (pageArguments.walletNewVM! - .nameExists(walletEditViewModel.newName)) { + if (!pageArguments.isWalletGroup && + pageArguments.walletNewVM! + .nameExists(walletEditViewModel.newName)) { showPopUp( context: context, builder: (_) {