@@ -335,8 +335,12 @@ class AccountNotFoundException implements Exception {}
335
335
/// Calling [PerAccountStore.dispose] also disposes the [CorePerAccountStore]
336
336
/// (for example, it calls [ApiConnection.dispose] on [connection] ).
337
337
class CorePerAccountStore {
338
- CorePerAccountStore ._({required this .connection});
338
+ CorePerAccountStore ._({
339
+ required GlobalStore globalStore,
340
+ required this .connection,
341
+ }) : _globalStore = globalStore;
339
342
343
+ final GlobalStore _globalStore;
340
344
final ApiConnection connection; // TODO(#135): update zulipFeatureLevel with events
341
345
}
342
346
@@ -348,6 +352,8 @@ abstract class PerAccountStoreBase {
348
352
349
353
final CorePerAccountStore _core;
350
354
355
+ GlobalStore get _globalStore => _core._globalStore;
356
+
351
357
ApiConnection get connection => _core.connection;
352
358
}
353
359
@@ -392,7 +398,10 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
392
398
}
393
399
394
400
final realmUrl = account.realmUrl;
395
- final core = CorePerAccountStore ._(connection: connection);
401
+ final core = CorePerAccountStore ._(
402
+ globalStore: globalStore,
403
+ connection: connection,
404
+ );
396
405
final channels = ChannelStoreImpl (initialSnapshot: initialSnapshot);
397
406
return PerAccountStore ._(
398
407
globalStore: globalStore,
@@ -465,7 +474,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
465
474
}) : assert (realmUrl == globalStore.getAccount (accountId)! .realmUrl),
466
475
assert (realmUrl == core.connection.realmUrl),
467
476
assert (emoji.realmUrl == realmUrl),
468
- _globalStore = globalStore,
469
477
_realmEmptyTopicDisplayName = realmEmptyTopicDisplayName,
470
478
_emoji = emoji,
471
479
_users = users,
@@ -478,8 +486,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
478
486
////////////////////////////////
479
487
// Where data comes from in the first place.
480
488
481
- final GlobalStore _globalStore;
482
-
483
489
final String queueId;
484
490
UpdateMachine ? get updateMachine => _updateMachine;
485
491
UpdateMachine ? _updateMachine;
0 commit comments