From 5c643cc7962cd1ead760beaf7497871b7393483b Mon Sep 17 00:00:00 2001 From: infinite-persistence <64950861+infinite-persistence@users.noreply.github.com> Date: Wed, 24 Nov 2021 08:11:25 -0800 Subject: [PATCH] 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. --- ui/component/claimListDiscover/view.jsx | 2 ++ ui/component/claimTilesDiscover/index.js | 1 + ui/component/settingContent/view.jsx | 29 ++++++++++++------------ ui/redux/reducers/settings.js | 4 ++-- ui/util/buildHomepage.js | 2 +- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ui/component/claimListDiscover/view.jsx b/ui/component/claimListDiscover/view.jsx index 90e66d24e..6ec38e64f 100644 --- a/ui/component/claimListDiscover/view.jsx +++ b/ui/component/claimListDiscover/view.jsx @@ -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) { diff --git a/ui/component/claimTilesDiscover/index.js b/ui/component/claimTilesDiscover/index.js index c6fa6dd6f..1a18c5bcb 100644 --- a/ui/component/claimTilesDiscover/index.js +++ b/ui/component/claimTilesDiscover/index.js @@ -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) { diff --git a/ui/component/settingContent/view.jsx b/ui/component/settingContent/view.jsx index f86251318..502e5b5b1 100644 --- a/ui/component/settingContent/view.jsx +++ b/ui/component/settingContent/view.jsx @@ -93,22 +93,23 @@ export default function SettingContent(props: Props) { /> + + { + if (isAuthenticated) { + let param = e.target.checked ? { add: 'noreposts' } : { remove: 'noreposts' }; + Lbryio.call('user_tag', 'edit', param); + } + setClientSetting(SETTINGS.HIDE_REPOSTS, !hideReposts); + }} + /> + + {!SIMPLE_SITE && ( <> - - { - if (isAuthenticated) { - let param = e.target.checked ? { add: 'noreposts' } : { remove: 'noreposts' }; - Lbryio.call('user_tag', 'edit', param); - } - setClientSetting(SETTINGS.HIDE_REPOSTS, !hideReposts); - }} - /> - - {/* { 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,