Skip to content

Commit 89e1ac4

Browse files
PIG208gnprice
authored andcommitted
channel [nfc]: Make ChannelStoreImpl extend PerAccountStoreBase
It will need access to connection for fetching topics later.
1 parent 193ee91 commit 89e1ac4

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
@@ -165,8 +165,11 @@ enum UserTopicVisibilityEffect {
165165
/// Generally the only code that should need this class is [PerAccountStore]
166166
/// itself. Other code accesses this functionality through [PerAccountStore],
167167
/// or through the mixin [ChannelStore] which describes its interface.
168-
class ChannelStoreImpl with ChannelStore {
169-
factory ChannelStoreImpl({required InitialSnapshot initialSnapshot}) {
168+
class ChannelStoreImpl extends PerAccountStoreBase with ChannelStore {
169+
factory ChannelStoreImpl({
170+
required CorePerAccountStore core,
171+
required InitialSnapshot initialSnapshot,
172+
}) {
170173
final subscriptions = Map.fromEntries(initialSnapshot.subscriptions.map(
171174
(subscription) => MapEntry(subscription.streamId, subscription)));
172175

@@ -186,6 +189,7 @@ class ChannelStoreImpl with ChannelStore {
186189
}
187190

188191
return ChannelStoreImpl._(
192+
core: core,
189193
streams: streams,
190194
streamsByName: streams.map((_, stream) => MapEntry(stream.name, stream)),
191195
subscriptions: subscriptions,
@@ -194,6 +198,7 @@ class ChannelStoreImpl with ChannelStore {
194198
}
195199

196200
ChannelStoreImpl._({
201+
required super.core,
197202
required this.streams,
198203
required this.streamsByName,
199204
required this.subscriptions,

lib/model/store.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ class PerAccountStore extends PerAccountStoreBase with
480480
accountId: accountId,
481481
selfUserId: account.userId,
482482
);
483-
final channels = ChannelStoreImpl(initialSnapshot: initialSnapshot);
483+
final channels = ChannelStoreImpl(
484+
core: core, initialSnapshot: initialSnapshot);
484485
return PerAccountStore._(
485486
core: core,
486487
groups: UserGroupStoreImpl(core: core,

0 commit comments

Comments
 (0)