Improve reliability of screen titles
This commit is contained in:
parent
b2160ae159
commit
a3bca154c4
16 changed files with 60 additions and 37 deletions
|
@ -6,14 +6,14 @@ import {PostThread as PostThreadComponent} from '../com/post-thread/PostThread'
|
|||
import {ScreenParams} from '../routes'
|
||||
import {useStores} from '../../state'
|
||||
|
||||
export const PostThread = ({visible, params}: ScreenParams) => {
|
||||
export const PostThread = ({navIdx, visible, params}: ScreenParams) => {
|
||||
const store = useStores()
|
||||
const {name, rkey} = params
|
||||
const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey)
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
store.nav.setTitle(`Post by ${name}`)
|
||||
store.nav.setTitle(navIdx, `Post by ${name}`)
|
||||
}
|
||||
}, [visible, store.nav, name])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue