diff options
author | Eric Bailey <git@esb.lol> | 2023-11-08 13:55:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-08 11:55:38 -0800 |
commit | bd531f2344c181261afaf8c43c96daf569b58f09 (patch) | |
tree | 631334df0390c14742016dc4a282457e662a3fc8 /src/view/com/composer/Composer.tsx | |
parent | f18b15241ab708f8c25a11937a875e361e9f1221 (diff) | |
download | voidsky-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/composer/Composer.tsx')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 68f706828..cdc9768f7 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -53,9 +53,8 @@ import {useModals, useModalControls} from '#/state/modals' import {useRequireAltTextEnabled} from '#/state/preferences' import { useLanguagePrefs, - useSetLanguagePrefs, + useLanguagePrefsApi, toPostLanguages, - savePostLanguageToHistory, } from '#/state/preferences/languages' type Props = ComposerOpts @@ -73,7 +72,7 @@ export const ComposePost = observer(function ComposePost({ const store = useStores() const requireAltTextEnabled = useRequireAltTextEnabled() const langPrefs = useLanguagePrefs() - const setLangPrefs = useSetLanguagePrefs() + const setLangPrefs = useLanguagePrefsApi() const textInput = useRef<TextInputRef>(null) const [isKeyboardVisible] = useIsKeyboardVisible({iosUseWillEvents: true}) const [isProcessing, setIsProcessing] = useState(false) @@ -245,7 +244,7 @@ export const ComposePost = observer(function ComposePost({ if (!replyTo) { store.me.mainFeed.onPostCreated() } - savePostLanguageToHistory(setLangPrefs) + setLangPrefs.savePostLanguageToHistory() onPost?.() onClose() Toast.show(`Your ${replyTo ? 'reply' : 'post'} has been published`) |