fix(flags): align board flag rendering (#1142)

* fix(flags): align board flag rendering

* ci: run react doctor on changed pr files
This commit is contained in:
Tommaso Casaburi
2026-05-27 16:06:13 +07:00
committed by GitHub
parent 45a113c621
commit 029939089f
7 changed files with 112 additions and 24 deletions
+2 -1
View File
@@ -70,6 +70,7 @@ import { getThreadPostCountsByAuthor } from '../../lib/utils/author-post-counts'
import { withResolvedCommentCommunityAddress } from '../../lib/utils/comment-utils';
import { getFeedPostHeightEstimate, getReplyHeightEstimates, reportReplyHeightAuditSample } from '../../lib/utils/pretext-height-estimates';
import { getAuthorBadge } from '../../lib/utils/author-display-utils';
import { hasCommentFlagsForDirectory } from '../../lib/comment-flag-selection';
const { addChallenge } = useChallengesStore.getState();
@@ -242,7 +243,7 @@ const PostInfo = ({
const directories = useDirectories();
const directoryEntry = communityAddress ? findDirectoryByAddress(directories, communityAddress) : undefined;
const boardPath = communityAddress ? getBoardPath(communityAddress, directories) : undefined;
const showAuthorFlags = directoryEntry?.features?.hasFlags === true && !(deleted || removed || purged);
const showAuthorFlags = hasCommentFlagsForDirectory(directoryEntry) && !(deleted || removed || purged);
const postMenuProps = selectPostMenuProps(post);
const params = useParams();
+2 -1
View File
@@ -59,6 +59,7 @@ import { getThreadPostCountsByAuthor } from '../../lib/utils/author-post-counts'
import { withResolvedCommentCommunityAddress } from '../../lib/utils/comment-utils';
import { getFeedPostHeightEstimate, getReplyHeightEstimates, reportReplyHeightAuditSample } from '../../lib/utils/pretext-height-estimates';
import { getAuthorBadge } from '../../lib/utils/author-display-utils';
import { hasCommentFlagsForDirectory } from '../../lib/comment-flag-selection';
const { addChallenge } = useChallengesStore.getState();
@@ -89,7 +90,7 @@ const PostInfoAndMedia = ({
const purged = resolvedPost?.commentModeration?.purged;
const boardPath = communityAddress ? getBoardPath(communityAddress, directories) : undefined;
const directoryEntry = communityAddress ? findDirectoryByAddress(directories, communityAddress) : undefined;
const showAuthorFlags = directoryEntry?.features?.hasFlags === true && !(deleted || removed || purged);
const showAuthorFlags = hasCommentFlagsForDirectory(directoryEntry) && !(deleted || removed || purged);
const displayBoardPath =
boardPath && communityAddress
? boardPath !== communityAddress