mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-03 05:23:18 -05:00
Fix WebUI crash when language detection code returns undefined
(#33683)
This commit is contained in:
parent
607f65a0a5
commit
8dcfd3f246
@ -78,6 +78,9 @@ const detectedLanguage = createSelector([
|
|||||||
], text => {
|
], text => {
|
||||||
if (text.length > 20) {
|
if (text.length > 20) {
|
||||||
const guesses = debouncedLande(text);
|
const guesses = debouncedLande(text);
|
||||||
|
if (!guesses)
|
||||||
|
return '';
|
||||||
|
|
||||||
const [lang, confidence] = guesses[0];
|
const [lang, confidence] = guesses[0];
|
||||||
|
|
||||||
if (confidence > 0.8) {
|
if (confidence > 0.8) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user