From 9520fdb246ba470da20fa3676ca6474820a476d3 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 6 Jan 2025 18:20:53 -0600 Subject: [PATCH] Comment --- src/state/queries/threadgate/util.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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