Mfm autocomplete: remove unnecessary curry
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
This commit is contained in:
parent
b95bb64ecf
commit
3c840d1805
1 changed files with 3 additions and 8 deletions
|
@ -15,7 +15,6 @@ const MFM_TAGS = ['blur', 'bounce', 'flip', 'font', 'jelly', 'jump', 'rainbow',
|
|||
|
||||
export default data => {
|
||||
const emojiCurry = suggestEmoji(data.emoji)
|
||||
const mfmCurry = suggestMfm()
|
||||
const usersCurry = data.store && suggestUsers(data.store)
|
||||
return input => {
|
||||
const firstChar = input[0]
|
||||
|
@ -25,18 +24,14 @@ export default data => {
|
|||
if (firstChar === '@' && usersCurry) {
|
||||
return usersCurry(input)
|
||||
}
|
||||
if (firstChar === '$' && mfmCurry) {
|
||||
return mfmCurry(input)
|
||||
if (firstChar === '$') {
|
||||
return MFM_TAGS
|
||||
.filter(({ replacement }) => replacement.toLowerCase().indexOf(input) !== -1)
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
export const suggestMfm = () => input => {
|
||||
return MFM_TAGS
|
||||
.filter(({ replacement }) => replacement.toLowerCase().indexOf(input) !== -1)
|
||||
}
|
||||
|
||||
export const suggestEmoji = emojis => input => {
|
||||
const noPrefix = input.toLowerCase().substr(1)
|
||||
return emojis
|
||||
|
|
Loading…
Reference in a new issue