mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-09 00:12:13 -05:00
[Glitch] Fix WebUI crash when language detection code returns undefined
Port 8dcfd3f246ff68d5bd190d57a8b7c422076a4943 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
bfb9092890
commit
38905ae658
@ -78,6 +78,9 @@ const detectedLanguage = createSelector([
|
||||
], text => {
|
||||
if (text.length > 20) {
|
||||
const guesses = debouncedLande(text);
|
||||
if (!guesses)
|
||||
return '';
|
||||
|
||||
const [lang, confidence] = guesses[0];
|
||||
|
||||
if (confidence > 0.8) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user