File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,14 @@ abstract class GlobalStore extends ChangeNotifier {
142
142
/// This method should be called only by the implementation of [perAccount] .
143
143
/// Other callers interested in per-account data should use [perAccount]
144
144
/// and/or [perAccountSync] .
145
- Future <PerAccountStore > loadPerAccount (int accountId);
145
+ Future <PerAccountStore > loadPerAccount (int accountId) {
146
+ return doLoadPerAccount (accountId);
147
+ }
148
+
149
+ /// Load per-account data for the given account, unconditionally.
150
+ ///
151
+ /// This method should be called only by [loadPerAccount] .
152
+ Future <PerAccountStore > doLoadPerAccount (int accountId);
146
153
147
154
// Just the Iterables, not the actual Map, to avoid clients mutating the map.
148
155
// Mutations should go through the setters/mutators below.
@@ -650,7 +657,7 @@ class LiveGlobalStore extends GlobalStore {
650
657
final AppDatabase _db;
651
658
652
659
@override
653
- Future <PerAccountStore > loadPerAccount (int accountId) async {
660
+ Future <PerAccountStore > doLoadPerAccount (int accountId) async {
654
661
final updateMachine = await UpdateMachine .load (this , accountId);
655
662
return updateMachine.store;
656
663
}
Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ class LoadingTestGlobalStore extends TestGlobalStore {
603
603
Map <int , List <Completer <PerAccountStore >>> completers = {};
604
604
605
605
@override
606
- Future <PerAccountStore > loadPerAccount (int accountId) {
606
+ Future <PerAccountStore > doLoadPerAccount (int accountId) {
607
607
final completer = Completer <PerAccountStore >();
608
608
(completers[accountId] ?? = []).add (completer);
609
609
return completer.future;
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ class TestGlobalStore extends GlobalStore {
106
106
}
107
107
108
108
@override
109
- Future <PerAccountStore > loadPerAccount (int accountId) {
109
+ Future <PerAccountStore > doLoadPerAccount (int accountId) {
110
110
final initialSnapshot = _initialSnapshots[accountId]! ;
111
111
final store = PerAccountStore .fromInitialSnapshot (
112
112
globalStore: this ,
You can’t perform that action at this time.
0 commit comments