Просмотр исходного кода

perform null check on the old value instead of the new one since to follow the non-react version behaviour

GitOrigin-RevId: 33ef74e1b1da41db8a86fc79ae04fbe49ed194df
M Fahru 3 лет назад
Родитель
Сommit
82cd2d2a77

+ 2 - 1
services/web/frontend/js/features/editor-left-menu/hooks/use-set-spell-check-language.tsx

@@ -12,7 +12,8 @@ export default function useSetSpellCheckLanguage() {
   return useCallback(
     (newSpellCheckLanguage: ProjectSettings['spellCheckLanguage']) => {
       const allowUpdate =
-        newSpellCheckLanguage && newSpellCheckLanguage !== spellCheckLanguage
+        spellCheckLanguage != null &&
+        newSpellCheckLanguage !== spellCheckLanguage
 
       if (allowUpdate) {
         setSpellCheckLanguage(newSpellCheckLanguage)