Allow Wallet Group Names to be the same as Wallet Names (#1730)
Some checks failed
Cache Dependencies / test (push) Has been cancelled

* 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
This commit is contained in:
David Adegoke 2024-10-08 01:07:27 +01:00 committed by GitHub
parent 37b822b7f5
commit 62f55ae8f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -378,7 +378,11 @@ Future<void> setup({
getIt.registerFactory<NewWalletTypeViewModel>(() => NewWalletTypeViewModel(_walletInfoSource)); getIt.registerFactory<NewWalletTypeViewModel>(() => NewWalletTypeViewModel(_walletInfoSource));
getIt.registerFactory<WalletManager>( getIt.registerFactory<WalletManager>(
() => WalletManager(_walletInfoSource, getIt.get<SharedPreferences>()), () {
final instance = WalletManager(_walletInfoSource, getIt.get<SharedPreferences>());
instance.updateWalletGroups();
return instance;
},
); );
getIt.registerFactoryParam<WalletGroupsDisplayViewModel, WalletType, void>( getIt.registerFactoryParam<WalletGroupsDisplayViewModel, WalletType, void>(

View file

@ -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:cake_wallet/src/screens/base_page.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
class WalletEditPage extends BasePage { class WalletEditPage extends BasePage {
WalletEditPage({ WalletEditPage({
required this.pageArguments, required this.pageArguments,
@ -86,8 +85,9 @@ class WalletEditPage extends BasePage {
child: LoadingPrimaryButton( child: LoadingPrimaryButton(
onPressed: () async { onPressed: () async {
if (_formKey.currentState?.validate() ?? false) { if (_formKey.currentState?.validate() ?? false) {
if (pageArguments.walletNewVM! if (!pageArguments.isWalletGroup &&
.nameExists(walletEditViewModel.newName)) { pageArguments.walletNewVM!
.nameExists(walletEditViewModel.newName)) {
showPopUp<void>( showPopUp<void>(
context: context, context: context,
builder: (_) { builder: (_) {