Skip to content

Commit f0de00e

Browse files
committed
channel [nfc]: Make ChannelStoreImpl extend PerAccountStoreBase
It will need access to connection for fetching topics later.
1 parent 1a3d8e9 commit f0de00e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/model/channel.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ enum VisibilityEffect {
161161
/// Generally the only code that should need this class is [PerAccountStore]
162162
/// itself. Other code accesses this functionality through [PerAccountStore],
163163
/// or through the mixin [ChannelStore] which describes its interface.
164-
class ChannelStoreImpl with ChannelStore {
165-
factory ChannelStoreImpl({required InitialSnapshot initialSnapshot}) {
164+
class ChannelStoreImpl extends PerAccountStoreBase with ChannelStore {
165+
factory ChannelStoreImpl({
166+
required CorePerAccountStore core,
167+
required InitialSnapshot initialSnapshot,
168+
}) {
166169
final subscriptions = Map.fromEntries(initialSnapshot.subscriptions.map(
167170
(subscription) => MapEntry(subscription.streamId, subscription)));
168171

@@ -182,6 +185,7 @@ class ChannelStoreImpl with ChannelStore {
182185
}
183186

184187
return ChannelStoreImpl._(
188+
core: core,
185189
streams: streams,
186190
streamsByName: streams.map((_, stream) => MapEntry(stream.name, stream)),
187191
subscriptions: subscriptions,
@@ -190,6 +194,7 @@ class ChannelStoreImpl with ChannelStore {
190194
}
191195

192196
ChannelStoreImpl._({
197+
required super.core,
193198
required this.streams,
194199
required this.streamsByName,
195200
required this.subscriptions,

lib/model/store.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
464464
accountId: accountId,
465465
selfUserId: account.userId,
466466
);
467-
final channels = ChannelStoreImpl(initialSnapshot: initialSnapshot);
467+
final channels = ChannelStoreImpl(
468+
core: core, initialSnapshot: initialSnapshot);
468469
return PerAccountStore._(
469470
core: core,
470471
realmWildcardMentionPolicy: initialSnapshot.realmWildcardMentionPolicy,

0 commit comments

Comments
 (0)