Browse Source

Don't send spellCheckLanguage request if the old value is the same as the new one

GitOrigin-RevId: 4ef34be7563ff707b6abd44dc8034293c88d2f72
M Fahru 3 năm trước cách đây
mục cha
commit
777beaadc3

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

@@ -11,7 +11,10 @@ export default function useSetSpellCheckLanguage() {
 
 
   const setSpellCheckLanguage = useCallback(
   const setSpellCheckLanguage = useCallback(
     (spellCheckLanguage: string) => {
     (spellCheckLanguage: string) => {
-      if (spellCheckLanguageScope) {
+      if (
+        spellCheckLanguageScope &&
+        spellCheckLanguage !== spellCheckLanguageScope
+      ) {
         sendMB('setting-changed', {
         sendMB('setting-changed', {
           changedSetting: 'spellCheckLanguage',
           changedSetting: 'spellCheckLanguage',
           changedSettingVal: spellCheckLanguage,
           changedSettingVal: spellCheckLanguage,