Prep threadgate shadow hack (#4970)

Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
Eric Bailey
2024-08-21 22:16:03 -05:00
committed by GitHub
parent 61f0be705d
commit d5c78b9183
6 changed files with 68 additions and 23 deletions
+20
View File
@@ -139,3 +139,23 @@ export function createThreadgateRecord(
hiddenReplies: threadgate.hiddenReplies || [],
}
}
export function createTempThreadgateView({
postUri,
hiddenReplies,
}: Pick<AppBskyFeedThreadgate.Record, 'hiddenReplies'> & {
postUri: string
}): AppBskyFeedDefs.ThreadgateView {
const record: AppBskyFeedThreadgate.Record = {
$type: 'app.bsky.feed.threadgate',
post: postUri,
allow: undefined,
hiddenReplies,
createdAt: new Date().toISOString(),
}
return {
$type: 'app.bsky.feed.defs#threadgateView',
uri: postUri,
record,
}
}