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

View file

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