Commit f39d4434 authored by Haelwenn's avatar Haelwenn

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 7632777e
......@@ -230,7 +230,7 @@ const updateSuggestionTags = (state, token) => {
return state.merge({
suggestions: state.get('tagHistory')
.filter(tag => tag.toLowerCase().startsWith(prefix.toLowerCase()))
.filter(tag => tag && tag.toLowerCase().startsWith(prefix.toLowerCase()))
.slice(0, 4)
.map(tag => '#' + tag),
suggestion_token: token,
......
......@@ -147,7 +147,7 @@ const updateSuggestionTags = (state, token) => {
return state.merge({
suggestions: state.get('tagHistory')
.filter(tag => tag.toLowerCase().startsWith(prefix.toLowerCase()))
.filter(tag => tag && tag.toLowerCase().startsWith(prefix.toLowerCase()))
.slice(0, 4)
.map(tag => '#' + tag),
suggestion_token: token,
......
Markdown is supported
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