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
This commit is contained in:
Haelwenn (lanodan) Monnier 2019-02-21 21:52:48 +01:00
parent 210a7a578a
commit cdf95800db
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
2 changed files with 2 additions and 2 deletions

View file

@ -216,7 +216,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,

View file

@ -133,7 +133,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,