Re-enable reposts on homepages (#352)
* Add remove_duplicates to tile/list claim_search except for Channel Page This removes the any duplicates from reposts. * Re-activate the "Hide reposts" setting * Category Rows: default to ['stream', 'repost'] unless specified otherwise.
This commit is contained in:
parent
781f1b712e
commit
5c643cc796
5 changed files with 21 additions and 17 deletions
|
@ -248,6 +248,7 @@ function ClaimListDiscover(props: Props) {
|
|||
has_source?: boolean,
|
||||
has_no_source?: boolean,
|
||||
limit_claims_per_channel?: number,
|
||||
remove_duplicates?: boolean,
|
||||
} = {
|
||||
page_size: dynamicPageSize,
|
||||
page,
|
||||
|
@ -259,6 +260,7 @@ function ClaimListDiscover(props: Props) {
|
|||
not_channel_ids: isChannel ? undefined : mutedAndBlockedChannelIds,
|
||||
not_tags: !showNsfw ? MATURE_TAGS : [],
|
||||
order_by: resolveOrderByOption(orderParam, sortByParam),
|
||||
remove_duplicates: isChannel ? undefined : true,
|
||||
};
|
||||
|
||||
if (ENABLE_NO_SOURCE_CLAIMS && hasNoSource) {
|
||||
|
|
|
@ -85,6 +85,7 @@ function resolveSearchOptions(props) {
|
|||
not_channel_ids: mutedAndBlockedChannelIds,
|
||||
order_by: orderBy || ['trending_group', 'trending_mixed'],
|
||||
stream_types: streamTypesParam,
|
||||
remove_duplicates: true,
|
||||
};
|
||||
|
||||
if (ENABLE_NO_SOURCE_CLAIMS && hasNoSource) {
|
||||
|
|
|
@ -93,12 +93,11 @@ export default function SettingContent(props: Props) {
|
|||
/>
|
||||
</SettingsRow>
|
||||
|
||||
{!SIMPLE_SITE && (
|
||||
<>
|
||||
<SettingsRow title={__('Hide reposts')} subtitle={__(HELP.HIDE_REPOSTS)}>
|
||||
<FormField
|
||||
type="checkbox"
|
||||
name="hide_reposts"
|
||||
checked={hideReposts}
|
||||
onChange={(e) => {
|
||||
if (isAuthenticated) {
|
||||
let param = e.target.checked ? { add: 'noreposts' } : { remove: 'noreposts' };
|
||||
|
@ -109,6 +108,8 @@ export default function SettingContent(props: Props) {
|
|||
/>
|
||||
</SettingsRow>
|
||||
|
||||
{!SIMPLE_SITE && (
|
||||
<>
|
||||
{/*
|
||||
<SettingsRow title={__('Show anonymous content')} subtitle={__('Anonymous content is published without a channel.')} >
|
||||
<FormField
|
||||
|
|
|
@ -4,7 +4,7 @@ import * as SHARED_PREFERENCES from 'constants/shared_preferences';
|
|||
import moment from 'moment';
|
||||
import { getSubsetFromKeysArray } from 'util/sync-settings';
|
||||
import { getDefaultLanguage } from 'util/default-languages';
|
||||
import { UNSYNCED_SETTINGS, SIMPLE_SITE } from 'config';
|
||||
import { UNSYNCED_SETTINGS } from 'config';
|
||||
import Comments from 'comments';
|
||||
|
||||
const { CLIENT_SYNC_KEYS } = SHARED_PREFERENCES;
|
||||
|
@ -73,7 +73,7 @@ const defaultState = {
|
|||
[SETTINGS.AUTOPLAY_MEDIA]: true,
|
||||
[SETTINGS.FLOATING_PLAYER]: true,
|
||||
[SETTINGS.AUTO_DOWNLOAD]: true,
|
||||
[SETTINGS.HIDE_REPOSTS]: SIMPLE_SITE,
|
||||
[SETTINGS.HIDE_REPOSTS]: false,
|
||||
|
||||
// OS
|
||||
[SETTINGS.AUTO_LAUNCH]: true,
|
||||
|
|
|
@ -111,7 +111,7 @@ export const getHomepageRowForCat = (cat: HomepageCat) => {
|
|||
title: cat.label,
|
||||
pinnedUrls: cat.pinnedUrls,
|
||||
options: {
|
||||
claimType: cat.claimType || 'stream',
|
||||
claimType: cat.claimType || ['stream', 'repost'],
|
||||
channelIds: cat.channelIds,
|
||||
orderBy: orderValue,
|
||||
pageSize: cat.pageSize || undefined,
|
||||
|
|
Loading…
Reference in a new issue