Ignore "search in language" setting in Channel Page (#944)

It's confusing to see blank channel pages due to this setting.
This commit is contained in:
infinite-persistence 2022-02-23 06:43:42 -08:00 committed by GitHub
parent 69de63c436
commit db5d0a70aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 9 deletions

View file

@ -179,6 +179,7 @@ function ChannelContent(props: Props) {
{!fetching && (
<ClaimListDiscover
ignoreSearchInLanguage
hasSource
defaultFreshness={CS.FRESH_ALL}
showHiddenByUser={viewHiddenChannels}
@ -201,6 +202,7 @@ function ChannelContent(props: Props) {
<Form onSubmit={() => {}} className="wunderbar--inline">
<Icon icon={ICONS.SEARCH} />
<FormField
name="channel_search"
className="wunderbar__input--inline"
value={searchQuery}
onChange={handleInputChange}

View file

@ -40,6 +40,7 @@ type Props = {
showHiddenByUser?: boolean,
showNoSourceClaims?: boolean,
tileLayout: boolean,
ignoreSearchInLanguage?: boolean,
orderBy?: Array<string>, // Trending, New, Top
defaultOrderBy?: string,
@ -155,6 +156,7 @@ function ClaimListDiscover(props: Props) {
forceShowReposts = false,
languageSetting,
searchInLanguage,
ignoreSearchInLanguage,
limitClaimsPerChannel,
releaseTime,
scrollAnchor,
@ -193,17 +195,18 @@ function ClaimListDiscover(props: Props) {
);
const langParam = urlParams.get(CS.LANGUAGE_KEY) || null;
const languageParams = searchInLanguage
? langParam === null
? languageSetting.concat(languageSetting === 'en' ? ',none' : '')
const languageParams =
searchInLanguage && !ignoreSearchInLanguage
? langParam === null
? languageSetting.concat(languageSetting === 'en' ? ',none' : '')
: langParam === 'any'
? null
: langParam.concat(langParam === 'en' ? ',none' : '')
: langParam === null
? null
: langParam === 'any'
? null
: langParam.concat(langParam === 'en' ? ',none' : '')
: langParam === null
? null
: langParam === 'any'
? null
: langParam.concat(langParam === 'en' ? ',none' : '');
: langParam.concat(langParam === 'en' ? ',none' : '');
let claimTypeParam = claimType || defaultClaimType || null;
let streamTypeParam = streamType || defaultStreamType || null;