Skip to content

Commit 6ef1996

Browse files
gnpricechrisbobbe
authored andcommitted
store [nfc]: On loading account, notify global listeners
This makes GlobalStore behave a bit more conventionally for a ChangeNotifier.
1 parent 35a9bb0 commit 6ef1996

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/model/store.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ abstract class GlobalStore extends ChangeNotifier {
9898
store = await future;
9999
_perAccountStores[accountId] = store;
100100
_perAccountStoresLoading.remove(accountId);
101+
notifyListeners();
101102
return store;
102103
}
103104

lib/widgets/store.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,8 @@ class _PerAccountStoreWidgetState extends State<PerAccountStoreWidget> {
192192
if (store != null) {
193193
_setStore(store);
194194
} else {
195-
// If we don't already have data, wait for it.
196-
(() async {
197-
_setStore(await globalStore.perAccount(widget.accountId));
198-
})();
195+
// If we don't already have data, request it.
196+
globalStore.perAccount(widget.accountId);
199197
}
200198
}
201199

0 commit comments

Comments
 (0)