diff --git a/lib/main.dart b/lib/main.dart index 7ac3170b6..478315623 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -72,6 +72,7 @@ import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/prefs.dart'; import 'package:stackwallet/utilities/stack_file_system.dart'; import 'package:stackwallet/utilities/util.dart'; +import 'package:stackwallet/wallets/isar/providers/all_wallets_info_provider.dart'; import 'package:stackwallet/widgets/crypto_notifications.dart'; import 'package:window_size/window_size.dart'; @@ -747,7 +748,7 @@ class _MaterialAppWithThemeState extends ConsumerState builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done) { // FlutterNativeSplash.remove(); - if (ref.read(pWallets).hasWallets || + if (ref.read(pAllWalletsInfo).isNotEmpty || ref.read(prefsChangeNotifierProvider).hasPin) { // return HomeView(); diff --git a/lib/pages/wallets_view/wallets_view.dart b/lib/pages/wallets_view/wallets_view.dart index 53f6f1a64..be33af927 100644 --- a/lib/pages/wallets_view/wallets_view.dart +++ b/lib/pages/wallets_view/wallets_view.dart @@ -16,6 +16,7 @@ import 'package:stackwallet/pages/wallets_view/sub_widgets/empty_wallets.dart'; import 'package:stackwallet/pages/wallets_view/sub_widgets/favorite_wallets.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/themes/theme_providers.dart'; +import 'package:stackwallet/wallets/isar/providers/all_wallets_info_provider.dart'; class WalletsView extends ConsumerWidget { const WalletsView({Key? key}) : super(key: key); @@ -25,7 +26,7 @@ class WalletsView extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { debugPrint("BUILD: $runtimeType"); - final hasWallets = ref.watch(pWallets).hasWallets; + final hasWallets = ref.watch(pAllWalletsInfo).isNotEmpty; final showFavorites = ref.watch(prefsChangeNotifierProvider .select((value) => value.showFavoriteWallets)); diff --git a/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart b/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart index f9fb117bf..bb9f9a646 100644 --- a/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart +++ b/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart @@ -16,9 +16,9 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/hidden_settings.dart'; import 'package:stackwallet/pages/wallets_view/sub_widgets/empty_wallets.dart'; import 'package:stackwallet/pages_desktop_specific/my_stack_view/my_wallets.dart'; -import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/wallets/isar/providers/all_wallets_info_provider.dart'; import 'package:stackwallet/widgets/animated_widgets/rotate_icon.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; @@ -36,7 +36,7 @@ class _MyStackViewState extends ConsumerState { @override Widget build(BuildContext context) { debugPrint("BUILD: $runtimeType"); - final hasWallets = ref.watch(pWallets).hasWallets; + final hasWallets = ref.watch(pAllWalletsInfo).isNotEmpty; return Background( child: Column( diff --git a/lib/services/wallets.dart b/lib/services/wallets.dart index 3e8ebc46f..e26eaf0ba 100644 --- a/lib/services/wallets.dart +++ b/lib/services/wallets.dart @@ -35,8 +35,6 @@ class Wallets { late NodeService nodeService; late MainDB mainDB; - bool get hasWallets => _wallets.isNotEmpty; - List get wallets => _wallets.values.toList(); static bool hasLoaded = false;