about summary refs log tree commit diff
path: root/src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-08 13:55:38 -0600
committerGitHub <noreply@github.com>2023-11-08 11:55:38 -0800
commitbd531f2344c181261afaf8c43c96daf569b58f09 (patch)
tree631334df0390c14742016dc4a282457e662a3fc8 /src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx
parentf18b15241ab708f8c25a11937a875e361e9f1221 (diff)
downloadvoidsky-bd531f2344c181261afaf8c43c96daf569b58f09.tar.zst
Pull language methods into api context (#1847)
* Pull language methods into api context

* Rename for consistency
Diffstat (limited to 'src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx')
-rw-r--r--src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx b/src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx
index d37d51e47..0b19abc68 100644
--- a/src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx
+++ b/src/view/com/modals/lang-settings/ContentLanguagesSettings.tsx
@@ -11,8 +11,7 @@ import {ConfirmLanguagesButton} from './ConfirmLanguagesButton'
 import {useModalControls} from '#/state/modals'
 import {
   useLanguagePrefs,
-  useSetLanguagePrefs,
-  toggleContentLanguage,
+  useLanguagePrefsApi,
 } from '#/state/preferences/languages'
 
 export const snapPoints = ['100%']
@@ -20,7 +19,7 @@ export const snapPoints = ['100%']
 export function Component({}: {}) {
   const {closeModal} = useModalControls()
   const langPrefs = useLanguagePrefs()
-  const setLangPrefs = useSetLanguagePrefs()
+  const setLangPrefs = useLanguagePrefsApi()
   const pal = usePalette('default')
   const {isMobile} = useWebMediaQueries()
   const onPressDone = React.useCallback(() => {
@@ -50,9 +49,9 @@ export function Component({}: {}) {
 
   const onPress = React.useCallback(
     (code2: string) => {
-      toggleContentLanguage(langPrefs, setLangPrefs, code2)
+      setLangPrefs.toggleContentLanguage(code2)
     },
-    [langPrefs, setLangPrefs],
+    [setLangPrefs],
   )
 
   return (