Skip to content

Commit 6706ce9

Browse files
committed
emoji [nfc]: Use PerAccountStoreBase for realmUrl
1 parent d764c3a commit 6706ce9

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

lib/model/emoji.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,12 @@ mixin EmojiStore {
137137
/// Generally the only code that should need this class is [PerAccountStore]
138138
/// itself. Other code accesses this functionality through [PerAccountStore],
139139
/// or through the mixin [EmojiStore] which describes its interface.
140-
class EmojiStoreImpl with EmojiStore {
140+
class EmojiStoreImpl extends PerAccountStoreBase with EmojiStore {
141141
EmojiStoreImpl({
142-
required this.realmUrl,
142+
required super.core,
143143
required this.allRealmEmoji,
144144
}) : _serverEmojiData = null; // TODO(#974) maybe start from a hard-coded baseline
145145

146-
/// The same as [PerAccountStore.realmUrl].
147-
final Uri realmUrl;
148-
149146
/// The realm's custom emoji, indexed by their [RealmEmojiItem.emojiCode],
150147
/// including deactivated emoji not available for new uses.
151148
///

lib/model/store.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
421421
throw Exception("bad initial snapshot: missing queueId");
422422
}
423423

424-
final realmUrl = account.realmUrl;
425424
final core = CorePerAccountStore._(
426425
globalStore: globalStore,
427426
connection: connection,
@@ -440,7 +439,7 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
440439
customProfileFields: _sortCustomProfileFields(initialSnapshot.customProfileFields),
441440
emailAddressVisibility: initialSnapshot.emailAddressVisibility,
442441
emoji: EmojiStoreImpl(
443-
realmUrl: realmUrl, allRealmEmoji: initialSnapshot.realmEmoji),
442+
core: core, allRealmEmoji: initialSnapshot.realmEmoji),
444443
userSettings: initialSnapshot.userSettings,
445444
typingNotifier: TypingNotifier(
446445
core: core,
@@ -490,8 +489,7 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
490489
required this.unreads,
491490
required this.recentDmConversationsView,
492491
required this.recentSenders,
493-
}) : assert(emoji.realmUrl == core.connection.realmUrl),
494-
_realmEmptyTopicDisplayName = realmEmptyTopicDisplayName,
492+
}) : _realmEmptyTopicDisplayName = realmEmptyTopicDisplayName,
495493
_emoji = emoji,
496494
_users = users,
497495
_channels = channels,

0 commit comments

Comments
 (0)