From 32987b46a932a692feeca44c245d553362fa0006 Mon Sep 17 00:00:00 2001 From: julian <julian@cypherstack.com> Date: Tue, 11 Apr 2023 09:59:24 -0600 Subject: [PATCH] desktop address list state bugfix --- .../addresses/desktop_wallet_addresses_view.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart b/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart index 54c5f4daa..3ba175b73 100644 --- a/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart +++ b/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart @@ -35,11 +35,13 @@ class _DesktopWalletAddressesViewState static const _headerHeight = 70.0; static const _columnWidth0 = 489.0; - late final Stream<void> addressCollectionWatcher; + Stream<void>? addressCollectionWatcher; void _onAddressCollectionWatcherEvent() { WidgetsBinding.instance.addPostFrameCallback((_) { - setState(() {}); + if (mounted) { + setState(() {}); + } }); } @@ -50,13 +52,14 @@ class _DesktopWalletAddressesViewState .isar .addresses .watchLazy(fireImmediately: true); - addressCollectionWatcher.listen((_) => _onAddressCollectionWatcherEvent()); + addressCollectionWatcher!.listen((_) => _onAddressCollectionWatcherEvent()); super.initState(); } @override void dispose() { + addressCollectionWatcher = null; super.dispose(); }