From 82cd2d2a77d7209ba85b7ca17377f54bf51f6057 Mon Sep 17 00:00:00 2001 From: M Fahru Date: Tue, 10 Jan 2023 08:17:39 -0700 Subject: [PATCH] perform null check on the old value instead of the new one since to follow the non-react version behaviour GitOrigin-RevId: 33ef74e1b1da41db8a86fc79ae04fbe49ed194df --- .../editor-left-menu/hooks/use-set-spell-check-language.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/editor-left-menu/hooks/use-set-spell-check-language.tsx b/services/web/frontend/js/features/editor-left-menu/hooks/use-set-spell-check-language.tsx index 4e9f2119a8..075b2106f3 100644 --- a/services/web/frontend/js/features/editor-left-menu/hooks/use-set-spell-check-language.tsx +++ b/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)