Skip to content

Commit

Permalink
Update naming and add comment (#10388)
Browse files Browse the repository at this point in the history
  • Loading branch information
abeddow91 authored Jan 29, 2024
1 parent 24dd18e commit f50e88f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dotcom-rendering/src/components/Discussion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ const commentIdFromUrl = () => {
return parseInt(commentId, 10);
};

const remapFilters = (
/**
* If a permalink is used and the threading is set to collapsed, this function remaps the threading filter to expanded.
* We do this to ensure that threads are expanded in the UI while respecting the user's local preference.
*/
const remapToValidFilters = (
filters: FilterOptions,
hashCommentId: number | undefined,
) => {
Expand Down Expand Up @@ -129,7 +133,7 @@ export const Discussion = ({
});
}, [filters, commentPage, shortUrlId]);

const validFilters = remapFilters(filters, hashCommentId);
const validFilters = remapToValidFilters(filters, hashCommentId);

useEffect(() => {
rememberFilters(filters);
Expand Down

0 comments on commit f50e88f

Please sign in to comment.