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

GitOrigin-RevId: 4ef34be7563ff707b6abd44dc8034293c88d2f72
This commit is contained in:
M Fahru 2022-12-28 10:34:25 -07:00 committed by Copybot
parent ae5a08e680
commit 777beaadc3

View file

@ -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,