···129129 currentAccount &&
130130 rootPostUri &&
131131 currentAccount?.did === new AtUri(rootPostUri).host
132132+ const initialThreadgateRecord = rootPost?.threadgate?.record as
133133+ | AppBskyFeedThreadgate.Record
134134+ | undefined
132135 const {data: threadgateRecord} = useThreadgateRecordQuery({
133136 /**
134137 * If the user is the OP and the root post has a threadgate, we should load
135138 * the threadgate record. Otherwise, fallback to initialData, which is taken
136139 * from the response from `getPostThread`.
137140 */
138138- enabled: Boolean(isOP && rootPostUri),
141141+ enabled: Boolean(isOP && rootPostUri && initialThreadgateRecord),
139142 postUri: rootPostUri,
140140- initialData: rootPost?.threadgate?.record as
141141- | AppBskyFeedThreadgate.Record
142142- | undefined,
143143+ initialData: initialThreadgateRecord,
143144 })
144145145146 const moderationOpts = useModerationOpts()