Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
72d939b6
Commit
72d939b6
authored
7 years ago
by
Nolan Lawson
Committed by
Eugen Rochko
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix thinking_face emoji autocomplete (#5238)
parent
97b3d0cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/javascript/mastodon/features/emoji/emoji_utils.js
+10
-7
10 additions, 7 deletions
app/javascript/mastodon/features/emoji/emoji_utils.js
spec/javascript/components/emoji_index.test.js
+7
-0
7 additions, 0 deletions
spec/javascript/components/emoji_index.test.js
with
17 additions
and
7 deletions
app/javascript/mastodon/features/emoji/emoji_utils.js
+
10
−
7
View file @
72d939b6
...
@@ -125,13 +125,16 @@ function getData(emoji) {
...
@@ -125,13 +125,16 @@ function getData(emoji) {
}
}
function
intersect
(
a
,
b
)
{
function
intersect
(
a
,
b
)
{
let
aSet
=
new
Set
(
a
);
let
set
;
let
bSet
=
new
Set
(
b
);
let
list
;
let
intersection
=
new
Set
(
if
(
a
.
length
<
b
.
length
)
{
[...
aSet
].
filter
(
x
=>
bSet
.
has
(
x
))
set
=
new
Set
(
a
);
);
list
=
b
;
}
else
{
return
Array
.
from
(
intersection
);
set
=
new
Set
(
b
);
list
=
a
;
}
return
Array
.
from
(
new
Set
(
list
.
filter
(
x
=>
set
.
has
(
x
))));
}
}
export
{
getData
,
getSanitizedData
,
intersect
};
export
{
getData
,
getSanitizedData
,
intersect
};
This diff is collapsed.
Click to expand it.
spec/javascript/components/emoji_index.test.js
+
7
−
0
View file @
72d939b6
...
@@ -96,4 +96,11 @@ describe('emoji_index', () => {
...
@@ -96,4 +96,11 @@ describe('emoji_index', () => {
expect
(
search
(
'
polo
'
).
map
(
trimEmojis
)).
to
.
deep
.
equal
(
expected
);
expect
(
search
(
'
polo
'
).
map
(
trimEmojis
)).
to
.
deep
.
equal
(
expected
);
expect
(
emojiIndex
.
search
(
'
polo
'
).
map
(
trimEmojis
)).
to
.
deep
.
equal
(
expected
);
expect
(
emojiIndex
.
search
(
'
polo
'
).
map
(
trimEmojis
)).
to
.
deep
.
equal
(
expected
);
});
});
it
(
'
can search for thinking_face
'
,
()
=>
{
let
expected
=
[
{
id
:
'
thinking_face
'
,
unified
:
'
1f914
'
,
native
:
'
🤔
'
}
];
expect
(
search
(
'
thinking_fac
'
).
map
(
trimEmojis
)).
to
.
deep
.
equal
(
expected
);
// this is currently broken in emoji-mart
// expect(emojiIndex.search('thinking_fac').map(trimEmojis)).to.deep.equal(expected);
});
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment