@@ -279,7 +279,6 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel
279
279
emoji: EmojiStoreImpl (
280
280
realmUrl: realmUrl, allRealmEmoji: initialSnapshot.realmEmoji),
281
281
accountId: accountId,
282
- selfUserId: account.userId,
283
282
userSettings: initialSnapshot.userSettings,
284
283
typingNotifier: TypingNotifier (
285
284
connection: connection,
@@ -288,7 +287,9 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel
288
287
typingStartedWaitPeriod: Duration (
289
288
milliseconds: initialSnapshot.serverTypingStartedWaitPeriodMilliseconds),
290
289
),
291
- users: UserStoreImpl (initialSnapshot: initialSnapshot),
290
+ users: UserStoreImpl (
291
+ selfUserId: account.userId,
292
+ initialSnapshot: initialSnapshot),
292
293
typingStatus: TypingStatus (
293
294
selfUserId: account.userId,
294
295
typingStartedExpiryPeriod: Duration (milliseconds: initialSnapshot.serverTypingStartedExpiryPeriodMilliseconds),
@@ -319,7 +320,6 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel
319
320
required this .emailAddressVisibility,
320
321
required EmojiStoreImpl emoji,
321
322
required this .accountId,
322
- required this .selfUserId,
323
323
required this .userSettings,
324
324
required this .typingNotifier,
325
325
required UserStoreImpl users,
@@ -329,8 +329,7 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel
329
329
required this .unreads,
330
330
required this .recentDmConversationsView,
331
331
required this .recentSenders,
332
- }) : assert (selfUserId == globalStore.getAccount (accountId)! .userId),
333
- assert (realmUrl == globalStore.getAccount (accountId)! .realmUrl),
332
+ }) : assert (realmUrl == globalStore.getAccount (accountId)! .realmUrl),
334
333
assert (realmUrl == connection.realmUrl),
335
334
assert (emoji.realmUrl == realmUrl),
336
335
_globalStore = globalStore,
@@ -428,16 +427,16 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel
428
427
/// Will throw if called after [dispose] has been called.
429
428
Account get account => _globalStore.getAccount (accountId)! ;
430
429
431
- /// Always equal to `account.userId` .
432
- final int selfUserId;
433
-
434
430
final UserSettings ? userSettings; // TODO(server-5)
435
431
436
432
final TypingNotifier typingNotifier;
437
433
438
434
////////////////////////////////
439
435
// Users and data about them.
440
436
437
+ @override
438
+ int get selfUserId => _users.selfUserId;
439
+
441
440
@override
442
441
Map <int , User > get users => _users.users;
443
442
0 commit comments