Skip to content

Commit d1b0812

Browse files
committed
user [nfc]: Provide RealmStore to UserStore
1 parent 1d62146 commit d1b0812

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/model/store.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ class PerAccountStore extends PerAccountStoreBase with
495495
savedSnippets: SavedSnippetStoreImpl(core: core,
496496
savedSnippets: initialSnapshot.savedSnippets ?? []),
497497
typingNotifier: TypingNotifier(realm: realm),
498-
users: UserStoreImpl(core: core, initialSnapshot: initialSnapshot),
498+
users: UserStoreImpl(realm: realm, initialSnapshot: initialSnapshot),
499499
typingStatus: TypingStatus(realm: realm),
500500
presence: Presence(realm: realm,
501501
initial: initialSnapshot.presences),

lib/model/user.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import '../api/model/model.dart';
44
import 'algorithms.dart';
55
import 'localizations.dart';
66
import 'narrow.dart';
7+
import 'realm.dart';
78
import 'store.dart';
89

910
/// The portion of [PerAccountStore] describing the users in the realm.
10-
mixin UserStore on PerAccountStoreBase {
11+
mixin UserStore on PerAccountStoreBase, RealmStore {
1112
/// The user with the given ID, if that user is known.
1213
///
1314
/// There may be other users that are perfectly real but are
@@ -131,9 +132,9 @@ enum MutedUsersVisibilityEffect {
131132
/// Generally the only code that should need this class is [PerAccountStore]
132133
/// itself. Other code accesses this functionality through [PerAccountStore],
133134
/// or through the mixin [UserStore] which describes its interface.
134-
class UserStoreImpl extends PerAccountStoreBase with UserStore {
135+
class UserStoreImpl extends HasRealmStore with UserStore {
135136
UserStoreImpl({
136-
required super.core,
137+
required super.realm,
137138
required InitialSnapshot initialSnapshot,
138139
}) : _users = Map.fromEntries(
139140
initialSnapshot.realmUsers

0 commit comments

Comments
 (0)