Hide the "results filtered by language" hint if the Category forced the language-specific search.

The user won't be able to anything about it anyway.
This commit is contained in:
infinite-persistence 2022-04-19 19:42:33 +08:00
parent 7b85d7a585
commit 9ad73c9878
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -45,7 +45,7 @@ type Props = {
showNoSourceClaims?: boolean, showNoSourceClaims?: boolean,
tileLayout: boolean, tileLayout: boolean,
searchLanguages?: Array<string>, searchLanguages?: Array<string>,
ignoreSearchInLanguage?: boolean, ignoreSearchInLanguage?: boolean, // Negate the redux setting where it doesn't make sense.
orderBy?: Array<string>, // Trending, New, Top orderBy?: Array<string>, // Trending, New, Top
defaultOrderBy?: string, defaultOrderBy?: string,
@ -219,8 +219,9 @@ function ClaimListDiscover(props: Props) {
// - languageSetting (redux setting) // - languageSetting (redux setting)
const language = searchLanguages ? searchLanguages.join(',') : languageSetting; const language = searchLanguages ? searchLanguages.join(',') : languageSetting;
const langParam = urlParams.get(CS.LANGUAGE_KEY) || null; const langParam = urlParams.get(CS.LANGUAGE_KEY) || null;
const searchInSelectedLangOnly = Boolean(searchLanguages) || (searchInLanguage && !ignoreSearchInLanguage); const forcedSearchInLanguage = Boolean(searchLanguages);
const languageParams = resolveLangForClaimSearch(language, searchInSelectedLangOnly, langParam); const userSearchInLanguage = searchInLanguage && !ignoreSearchInLanguage;
const languageParams = resolveLangForClaimSearch(language, forcedSearchInLanguage || userSearchInLanguage, langParam);
let claimTypeParam = claimType || defaultClaimType || null; let claimTypeParam = claimType || defaultClaimType || null;
let streamTypeParam = streamType || defaultStreamType || null; let streamTypeParam = streamType || defaultStreamType || null;
@ -701,7 +702,7 @@ function ClaimListDiscover(props: Props) {
<div className="section__header--actions"> <div className="section__header--actions">
<div className="section__actions"> <div className="section__actions">
{headerToUse} {headerToUse}
{searchInSelectedLangOnly && <LangFilterIndicator />} {userSearchInLanguage && <LangFilterIndicator />}
</div> </div>
{meta && <div className="section__actions--no-margin">{meta}</div>} {meta && <div className="section__actions--no-margin">{meta}</div>}
</div> </div>
@ -741,7 +742,7 @@ function ClaimListDiscover(props: Props) {
<div className="section__header--actions"> <div className="section__header--actions">
<div className="section__actions"> <div className="section__actions">
{headerToUse} {headerToUse}
{searchInSelectedLangOnly && <LangFilterIndicator />} {userSearchInLanguage && <LangFilterIndicator />}
</div> </div>
{meta && <div className="section__actions--no-margin">{meta}</div>} {meta && <div className="section__actions--no-margin">{meta}</div>}
</div> </div>