about summary refs log tree commit diff
path: root/src/view/com/post-thread/PostThread.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-05-17 12:30:54 -0500
committerPaul Frazee <pfrazee@gmail.com>2023-05-17 12:30:54 -0500
commit7aa1d9010e26da14a843efab0389386144cc978a (patch)
tree31ac7916fd7e1045bce0a078d67cc1164cc2e42f /src/view/com/post-thread/PostThread.tsx
parent52c72d65326c2df6ada7547103c18ed41b51ebda (diff)
parent0ca096138a690f036828c49f9e95cf394b1a4339 (diff)
downloadvoidsky-7aa1d9010e26da14a843efab0389386144cc978a.tar.zst
Merge branch 'main' into custom-algos
Diffstat (limited to 'src/view/com/post-thread/PostThread.tsx')
-rw-r--r--src/view/com/post-thread/PostThread.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx
index b3da0b01b..610b96507 100644
--- a/src/view/com/post-thread/PostThread.tsx
+++ b/src/view/com/post-thread/PostThread.tsx
@@ -24,8 +24,10 @@ import {Text} from '../util/text/Text'
 import {s} from 'lib/styles'
 import {isDesktopWeb, isMobileWeb} from 'platform/detection'
 import {usePalette} from 'lib/hooks/usePalette'
+import {useSetTitle} from 'lib/hooks/useSetTitle'
 import {useNavigation} from '@react-navigation/native'
 import {NavigationProp} from 'lib/routes/types'
+import {sanitizeDisplayName} from 'lib/strings/display-names'
 
 const REPLY_PROMPT = {_reactKey: '__reply__', _isHighlightedPost: false}
 const DELETED = {_reactKey: '__deleted__', _isHighlightedPost: false}
@@ -59,6 +61,13 @@ export const PostThread = observer(function PostThread({
     }
     return []
   }, [view.thread])
+  useSetTitle(
+    view.thread?.postRecord &&
+      `${sanitizeDisplayName(
+        view.thread.post.author.displayName ||
+          `@${view.thread.post.author.handle}`,
+      )}: "${view.thread?.postRecord?.text}"`,
+  )
 
   // events
   // =