diff --git a/src/state/queries/threadgate/util.ts b/src/state/queries/threadgate/util.ts index c4eda74f47..75c1bdef1a 100644 --- a/src/state/queries/threadgate/util.ts +++ b/src/state/queries/threadgate/util.ts @@ -5,6 +5,7 @@ import {ThreadgateAllowUISetting} from '#/state/queries/threadgate/types' export function threadgateViewToAllowUISetting( threadgateView: AppBskyFeedDefs.ThreadgateView | undefined, ): ThreadgateAllowUISetting[] { + // Validate the record for clarity, since backwards compat code is a little confusing const threadgate = threadgateView && AppBskyFeedThreadgate.isValidRecord(threadgateView.record) ? threadgateView.record @@ -37,11 +38,11 @@ export function threadgateRecordToAllowUISetting( const settings: ThreadgateAllowUISetting[] = threadgate.allow .map(allow => { let setting: ThreadgateAllowUISetting | undefined - if (AppBskyFeedThreadgate.isValidMentionRule(allow)) { + if (AppBskyFeedThreadgate.isMentionRule(allow)) { setting = {type: 'mention'} - } else if (AppBskyFeedThreadgate.isValidFollowingRule(allow)) { + } else if (AppBskyFeedThreadgate.isFollowingRule(allow)) { setting = {type: 'following'} - } else if (AppBskyFeedThreadgate.isValidListRule(allow)) { + } else if (AppBskyFeedThreadgate.isListRule(allow)) { setting = {type: 'list', list: allow.list} } return setting