Verified Commit 3554d8fc authored by Haelwenn's avatar Haelwenn
Browse files

flavours/glitch/reducers/compose.js: Fix toLowerCase TypeError

[Error] TypeError: e.toLowerCase is not a function. (In 'e.toLowerCase()', 'e.toLowerCase' is undefined)

Some added context: https://queer.hacktivis.me/notice/9g4OfhpIWQLNoZ3mLI
parent 4700e27d
......@@ -295,7 +295,7 @@ const expiresInFromExpiresAt = expires_at => {
const mergeLocalHashtagResults = (suggestions, prefix, tagHistory) => {
prefix = prefix.toLowerCase();
if (suggestions.length < 4) {
const localTags = tagHistory.filter(tag => tag.toLowerCase().startsWith(prefix) && !suggestions.some(suggestion => suggestion.type === 'hashtag' && suggestion.name.toLowerCase() === tag.toLowerCase()));
const localTags = tagHistory.filter(tag => tag && tag.toLowerCase().startsWith(prefix) && !suggestions.some(suggestion => suggestion.type === 'hashtag' && suggestion.name.toLowerCase() === tag.toLowerCase()));
return suggestions.concat(localTags.slice(0, 4 - suggestions.length).toJS().map(tag => ({ type: 'hashtag', name: tag })));
} else {
return suggestions;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment