don't count 'lbry-first' towards max tag limit
This commit is contained in:
parent
3b65208edb
commit
2f1e126551
1 changed files with 9 additions and 4 deletions
|
@ -64,8 +64,13 @@ export default function TagsSearch(props: Props) {
|
||||||
const remainingUnfollowedTagsSet = setDifference(unfollowedTagsSet, selectedTagsSet);
|
const remainingUnfollowedTagsSet = setDifference(unfollowedTagsSet, selectedTagsSet);
|
||||||
const suggestedTagsSet = setUnion(remainingFollowedTagsSet, remainingUnfollowedTagsSet);
|
const suggestedTagsSet = setUnion(remainingFollowedTagsSet, remainingUnfollowedTagsSet);
|
||||||
|
|
||||||
const countWithoutMature = selectedTagsSet.has('mature') ? selectedTagsSet.size - 1 : selectedTagsSet.size;
|
let countWithoutSpecialTags = selectedTagsSet.has('mature') ? selectedTagsSet.size - 1 : selectedTagsSet.size;
|
||||||
const maxed = Boolean(limitSelect && countWithoutMature >= limitSelect);
|
if (selectedTagsSet.has('lbry-first')) {
|
||||||
|
countWithoutSpecialTags = countWithoutSpecialTags - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// const countWithoutLbryFirst = selectedTagsSet.has('lbry-first') ? selectedTagsSet.size - 1 : selectedTagsSet.size;
|
||||||
|
const maxed = Boolean(limitSelect && countWithoutSpecialTags >= limitSelect);
|
||||||
const suggestedTags = Array.from(suggestedTagsSet)
|
const suggestedTags = Array.from(suggestedTagsSet)
|
||||||
.filter(doesTagMatch)
|
.filter(doesTagMatch)
|
||||||
.slice(0, limitShow);
|
.slice(0, limitShow);
|
||||||
|
@ -93,7 +98,7 @@ export default function TagsSearch(props: Props) {
|
||||||
new Set(
|
new Set(
|
||||||
tags
|
tags
|
||||||
.split(',')
|
.split(',')
|
||||||
.slice(0, limitSelect - countWithoutMature)
|
.slice(0, limitSelect - countWithoutSpecialTags)
|
||||||
.map(newTag => newTag.trim().toLowerCase())
|
.map(newTag => newTag.trim().toLowerCase())
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -133,7 +138,7 @@ export default function TagsSearch(props: Props) {
|
||||||
{limitSelect < TAG_FOLLOW_MAX ? (
|
{limitSelect < TAG_FOLLOW_MAX ? (
|
||||||
<I18nMessage
|
<I18nMessage
|
||||||
tokens={{
|
tokens={{
|
||||||
number: limitSelect - countWithoutMature,
|
number: limitSelect - countWithoutSpecialTags,
|
||||||
selectTagsLabel: label,
|
selectTagsLabel: label,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Reference in a new issue