Pull language methods into api context (#1847)
* Pull language methods into api context * Rename for consistency
This commit is contained in:
parent
f18b15241a
commit
bd531f2344
7 changed files with 105 additions and 93 deletions
|
@ -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`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue