[Glitch] Fix WebUI crash when language detection code returns `undefined`
Port 8dcfd3f246
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
pull/2953/head
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…
Reference in New Issue