|
@@ -1,5 +1,4 @@
|
|
|
import { useCallback } from 'react'
|
|
import { useCallback } from 'react'
|
|
|
-import { sendMB } from '../../../infrastructure/event-tracking'
|
|
|
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
|
|
import useScopeValue from '../../../shared/hooks/use-scope-value'
|
|
import useScopeValue from '../../../shared/hooks/use-scope-value'
|
|
|
import {
|
|
import {
|
|
@@ -20,11 +19,6 @@ export default function useSetSpellCheckLanguage() {
|
|
|
newSpellCheckLanguage && newSpellCheckLanguage !== spellCheckLanguage
|
|
newSpellCheckLanguage && newSpellCheckLanguage !== spellCheckLanguage
|
|
|
|
|
|
|
|
if (allowUpdate) {
|
|
if (allowUpdate) {
|
|
|
- sendMB('setting-changed', {
|
|
|
|
|
- changedSetting: 'spellCheckLanguage',
|
|
|
|
|
- changedSettingVal: newSpellCheckLanguage,
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
setSpellCheckLanguage(newSpellCheckLanguage)
|
|
setSpellCheckLanguage(newSpellCheckLanguage)
|
|
|
|
|
|
|
|
// save to both project setting and user setting
|
|
// save to both project setting and user setting
|
|
@@ -32,7 +26,7 @@ export default function useSetSpellCheckLanguage() {
|
|
|
projectId,
|
|
projectId,
|
|
|
spellCheckLanguage: newSpellCheckLanguage,
|
|
spellCheckLanguage: newSpellCheckLanguage,
|
|
|
})
|
|
})
|
|
|
- saveUserSettings({ spellCheckLanguage: newSpellCheckLanguage })
|
|
|
|
|
|
|
+ saveUserSettings('spellCheckLanguage', newSpellCheckLanguage)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
[projectId, setSpellCheckLanguage, spellCheckLanguage]
|
|
[projectId, setSpellCheckLanguage, spellCheckLanguage]
|