File tree Expand file tree Collapse file tree 5 files changed +9
-12
lines changed Expand file tree Collapse file tree 5 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,7 @@ mixin EmojiStore {
115
115
///
116
116
/// See description in the web code:
117
117
/// https://github.com/zulip/zulip/blob/83a121c7e/web/shared/src/typeahead.ts#L3-L21
118
- // Someday this list may start varying rather than being hard-coded,
119
- // and then this will become a non-static member on EmojiStore.
120
- // For now, though, the fact it's constant is convenient when writing
121
- // tests of the logic that uses this data; so we guarantee it in the API.
122
- static Iterable <EmojiCandidate > get popularEmojiCandidates {
118
+ Iterable <EmojiCandidate > get popularEmojiCandidates {
123
119
return EmojiStoreImpl ._popularCandidates;
124
120
}
125
121
@@ -320,7 +316,7 @@ class EmojiStoreImpl extends PerAccountStoreBase with EmojiStore {
320
316
321
317
// Include the "popular" emoji, in their canonical order
322
318
// relative to each other.
323
- results.addAll (EmojiStore . popularEmojiCandidates);
319
+ results.addAll (popularEmojiCandidates);
324
320
325
321
final namesOverridden = {
326
322
for (final emoji in activeRealmEmoji) emoji.name,
Original file line number Diff line number Diff line change @@ -665,11 +665,12 @@ class ReactionButtons extends StatelessWidget {
665
665
666
666
@override
667
667
Widget build (BuildContext context) {
668
- assert (EmojiStore .popularEmojiCandidates.every (
668
+ final store = PerAccountStoreWidget .of (pageContext);
669
+ final popularEmojiCandidates = store.popularEmojiCandidates;
670
+ assert (popularEmojiCandidates.every (
669
671
(emoji) => emoji.emojiType == ReactionType .unicodeEmoji));
670
672
671
673
final zulipLocalizations = ZulipLocalizations .of (context);
672
- final store = PerAccountStoreWidget .of (pageContext);
673
674
final designVariables = DesignVariables .of (context);
674
675
675
676
bool hasSelfVote (EmojiCandidate emoji) {
@@ -685,7 +686,7 @@ class ReactionButtons extends StatelessWidget {
685
686
color: designVariables.contextMenuItemBg.withFadedAlpha (0.12 )),
686
687
child: Row (children: [
687
688
Flexible (child: Row (spacing: 1 , children: List .unmodifiable (
688
- EmojiStore . popularEmojiCandidates.mapIndexed ((index, emoji) =>
689
+ popularEmojiCandidates.mapIndexed ((index, emoji) =>
689
690
_buildButton (
690
691
context: context,
691
692
emoji: emoji,
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ void main() {
78
78
});
79
79
});
80
80
81
- final popularCandidates = EmojiStore .popularEmojiCandidates;
81
+ final popularCandidates = eg. store () .popularEmojiCandidates;
82
82
83
83
Condition <Object ?> isUnicodeCandidate (String ? emojiCode, List <String >? names) {
84
84
return (it_) {
Original file line number Diff line number Diff line change @@ -810,7 +810,7 @@ void main() {
810
810
811
811
group ('message action sheet' , () {
812
812
group ('ReactionButtons' , () {
813
- final popularCandidates = EmojiStore .popularEmojiCandidates;
813
+ final popularCandidates = eg. store () .popularEmojiCandidates;
814
814
815
815
for (final emoji in popularCandidates) {
816
816
final emojiDisplay = emoji.emojiDisplay as UnicodeEmojiDisplay ;
Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ void main() {
299
299
// - Non-animated image emoji is selected when intended
300
300
301
301
group ('EmojiPicker' , () {
302
- final popularCandidates = EmojiStore .popularEmojiCandidates;
302
+ final popularCandidates = eg. store () .popularEmojiCandidates;
303
303
304
304
Future <void > setupEmojiPicker (WidgetTester tester, {
305
305
required StreamMessage message,
You can’t perform that action at this time.
0 commit comments