Skip to content

Commit a53c08b

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

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
@@ -472,7 +472,8 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
472472
accountId: accountId,
473473
selfUserId: account.userId,
474474
);
475-
final channels = ChannelStoreImpl(initialSnapshot: initialSnapshot);
475+
final channels = ChannelStoreImpl(
476+
core: core, initialSnapshot: initialSnapshot);
476477
return PerAccountStore._(
477478
core: core,
478479
serverPresencePingIntervalSeconds: initialSnapshot.serverPresencePingIntervalSeconds,

0 commit comments

Comments
 (0)