@@ -338,10 +338,12 @@ class CorePerAccountStore {
338
338
CorePerAccountStore ._({
339
339
required GlobalStore globalStore,
340
340
required this .connection,
341
+ required this .accountId,
341
342
}) : _globalStore = globalStore;
342
343
343
344
final GlobalStore _globalStore;
344
345
final ApiConnection connection; // TODO(#135): update zulipFeatureLevel with events
346
+ final int accountId;
345
347
}
346
348
347
349
/// A base class for [PerAccountStore] and its substores,
@@ -352,9 +354,17 @@ abstract class PerAccountStoreBase {
352
354
353
355
final CorePerAccountStore _core;
354
356
357
+ ////////////////////////////////
358
+ // Where data comes from in the first place.
359
+
355
360
GlobalStore get _globalStore => _core._globalStore;
356
361
357
362
ApiConnection get connection => _core.connection;
363
+
364
+ ////////////////////////////////
365
+ // Data attached to the self-account on the realm.
366
+
367
+ int get accountId => _core.accountId;
358
368
}
359
369
360
370
/// Store for the user's data for a given Zulip account.
@@ -401,6 +411,7 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
401
411
final core = CorePerAccountStore ._(
402
412
globalStore: globalStore,
403
413
connection: connection,
414
+ accountId: accountId,
404
415
);
405
416
final channels = ChannelStoreImpl (initialSnapshot: initialSnapshot);
406
417
return PerAccountStore ._(
@@ -418,7 +429,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
418
429
emailAddressVisibility: initialSnapshot.emailAddressVisibility,
419
430
emoji: EmojiStoreImpl (
420
431
realmUrl: realmUrl, allRealmEmoji: initialSnapshot.realmEmoji),
421
- accountId: accountId,
422
432
userSettings: initialSnapshot.userSettings,
423
433
typingNotifier: TypingNotifier (
424
434
core: core,
@@ -461,7 +471,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
461
471
required this .customProfileFields,
462
472
required this .emailAddressVisibility,
463
473
required EmojiStoreImpl emoji,
464
- required this .accountId,
465
474
required this .userSettings,
466
475
required this .typingNotifier,
467
476
required UserStoreImpl users,
@@ -471,7 +480,7 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
471
480
required this .unreads,
472
481
required this .recentDmConversationsView,
473
482
required this .recentSenders,
474
- }) : assert (realmUrl == globalStore.getAccount (accountId)! .realmUrl),
483
+ }) : assert (realmUrl == globalStore.getAccount (core. accountId)! .realmUrl),
475
484
assert (realmUrl == core.connection.realmUrl),
476
485
assert (emoji.realmUrl == realmUrl),
477
486
_realmEmptyTopicDisplayName = realmEmptyTopicDisplayName,
@@ -572,8 +581,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
572
581
////////////////////////////////
573
582
// Data attached to the self-account on the realm.
574
583
575
- final int accountId;
576
-
577
584
/// The [Account] this store belongs to.
578
585
///
579
586
/// Will throw if the account has been removed from the global store,
0 commit comments