Skip to content

Commit fe30078

Browse files
committed
Clean up and add comment.
1 parent 61006ef commit fe30078

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/CodeSnippetDisplay.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,6 @@ export class CodeSnippetDisplay extends React.Component<
13091309
filterTags: string[],
13101310
selectedLangTags: string[]
13111311
): void => {
1312-
// TODO: when language tag is selected, only display tags that have that tag AND the snippet tags selected.
1313-
// filter with search
13141312
let matchIndices: number[][] = [];
13151313
const matchResults: StringExt.IMatchResult[] = [];
13161314
let filteredSnippets = this.props.codeSnippets;
@@ -1356,9 +1354,6 @@ export class CodeSnippetDisplay extends React.Component<
13561354
const newMatchIndices = matchIndices.slice();
13571355
filteredSnippets = filteredSnippets.filter((codeSnippet, id) => {
13581356
return filterTags.some((tag) => {
1359-
// check if filterTags has a language tag or pass in selectedLang tags
1360-
// then check if codeSnippet.language matches that lang. If it matches then
1361-
// filter by the rest of the selected snippet tags.
13621357
if (codeSnippet.tags) {
13631358
if (selectedLangTags.length !== 0) {
13641359
// lang tags selected

src/FilterTools.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export class FilterTools extends React.Component<
100100
!this.props.languageTags.includes(tag)
101101
) {
102102
if (selectedLanguageTags.length !== 0) {
103+
// if languages are selected, only display snippet tags that have snippets in those languages
103104
const langsMatch = this.props.tagDictionary
104105
.get(tag)
105106
.some((r) => selectedLanguageTags.includes(r));

0 commit comments

Comments
 (0)