zio/stable
Eric Bailey 2024-08-22 12:27:34 -05:00 committed by GitHub
parent 9f1c411360
commit 92989282ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -134,11 +134,9 @@ export function PostThread({uri}: {uri: string | undefined}) {
| undefined
const {data: threadgateRecord} = useThreadgateRecordQuery({
/**
* If the user is the OP and the root post has a threadgate, we should load
* the threadgate record. Otherwise, fallback to initialData, which is taken
* from the response from `getPostThread`.
* If the user is the OP and we have a root post, fetch the threadgate.
*/
enabled: Boolean(isOP && rootPostUri && initialThreadgateRecord),
enabled: Boolean(isOP && rootPostUri),
postUri: rootPostUri,
initialData: initialThreadgateRecord,
})