about summary refs log tree commit diff
path: root/src/view/com/post/Post.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-11-08 09:38:28 -0800
committerGitHub <noreply@github.com>2023-11-08 09:38:28 -0800
commit5843e212c0ebbfc6c3831929bbbaa72e1a289aba (patch)
tree08b6beed54700c56b65edbff32dc32baae0a4208 /src/view/com/post/Post.tsx
parente75b2d508baf9b19e7340657ac2951e9f057b735 (diff)
downloadvoidsky-5843e212c0ebbfc6c3831929bbbaa72e1a289aba.tar.zst
Move language preferences to new persistence + context (#1837)
Diffstat (limited to 'src/view/com/post/Post.tsx')
-rw-r--r--src/view/com/post/Post.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx
index db490333d..667584f68 100644
--- a/src/view/com/post/Post.tsx
+++ b/src/view/com/post/Post.tsx
@@ -34,6 +34,7 @@ import {MAX_POST_LINES} from 'lib/constants'
 import {countLines} from 'lib/strings/helpers'
 import {logger} from '#/logger'
 import {useMutedThreads, useToggleThreadMute} from '#/state/muted-threads'
+import {useLanguagePrefs} from '#/state/preferences'
 
 export const Post = observer(function PostImpl({
   view,
@@ -109,6 +110,7 @@ const PostLoaded = observer(function PostLoadedImpl({
   const store = useStores()
   const mutedThreads = useMutedThreads()
   const toggleThreadMute = useToggleThreadMute()
+  const langPrefs = useLanguagePrefs()
   const [limitLines, setLimitLines] = React.useState(
     countLines(item.richText?.text) >= MAX_POST_LINES,
   )
@@ -125,7 +127,7 @@ const PostLoaded = observer(function PostLoadedImpl({
 
   const translatorUrl = getTranslatorLink(
     record?.text || '',
-    store.preferences.primaryLanguage,
+    langPrefs.primaryLanguage,
   )
 
   const onPressReply = React.useCallback(() => {