From a010709cd8c41329e679f1a92acca3695d563f6f Mon Sep 17 00:00:00 2001 From: mocodesmo Date: Sun, 29 Dec 2024 13:15:08 +0530 Subject: [PATCH] RECEIVE - one wallet switching fixes --- lib/receive/bloc/receive_cubit.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/receive/bloc/receive_cubit.dart b/lib/receive/bloc/receive_cubit.dart index 01c28d67..24750898 100644 --- a/lib/receive/bloc/receive_cubit.dart +++ b/lib/receive/bloc/receive_cubit.dart @@ -24,7 +24,7 @@ class ReceiveCubit extends Cubit { ), ) { loadAddress(); - if (walletBloc != null) updateWalletBloc(walletBloc); + if (walletBloc != null) updateWalletBloc(walletBloc, fromInit: true); } final WalletAddress _walletAddress; @@ -36,8 +36,11 @@ class ReceiveCubit extends Cubit { return; } - Future updateWalletBloc(WalletBloc walletBloc) async { - // if (state.oneWallet) return; + Future updateWalletBloc( + WalletBloc walletBloc, { + bool fromInit = false, + }) async { + if (state.oneWallet && !fromInit) return; emit( state.copyWith( walletBloc: walletBloc,