desktop address list state bugfix

This commit is contained in:
julian 2023-04-11 09:59:24 -06:00
parent ce67673a94
commit 32987b46a9

View file

@ -35,11 +35,13 @@ class _DesktopWalletAddressesViewState
static const _headerHeight = 70.0; static const _headerHeight = 70.0;
static const _columnWidth0 = 489.0; static const _columnWidth0 = 489.0;
late final Stream<void> addressCollectionWatcher; Stream<void>? addressCollectionWatcher;
void _onAddressCollectionWatcherEvent() { void _onAddressCollectionWatcherEvent() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {}); if (mounted) {
setState(() {});
}
}); });
} }
@ -50,13 +52,14 @@ class _DesktopWalletAddressesViewState
.isar .isar
.addresses .addresses
.watchLazy(fireImmediately: true); .watchLazy(fireImmediately: true);
addressCollectionWatcher.listen((_) => _onAddressCollectionWatcherEvent()); addressCollectionWatcher!.listen((_) => _onAddressCollectionWatcherEvent());
super.initState(); super.initState();
} }
@override @override
void dispose() { void dispose() {
addressCollectionWatcher = null;
super.dispose(); super.dispose();
} }