+ );
+ }
+
+ React.useEffect(() => {
let nameError;
if (!name && name !== undefined) {
nameError = __('A name is required for your url');
@@ -525,7 +543,8 @@ function ChannelForm(props: Props) {
replace(`/$/${PAGES.CHANNELS}`)} />
- )}
+ )}
+ {getHideWatchedElem()}
>
}
/>
diff --git a/ui/component/claimListDiscover/view.jsx b/ui/component/claimListDiscover/view.jsx
index f15a20483..496a02019 100644
--- a/ui/component/claimListDiscover/view.jsx
+++ b/ui/component/claimListDiscover/view.jsx
@@ -318,25 +318,21 @@ function ClaimListDiscover(props: Props) {
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
- // Warning - hack below
- // If users are following more than 10 channels or tags, limit results to stuff less than a year old
- // For more than 20, drop it down to 6 months
- // This helps with timeout issues for users that are following a ton of stuff
- // https://github.com/lbryio/lbry-sdk/issues/2420
- if (
- (options.channel_ids && options.channel_ids.length > 20) ||
- (options.any_tags && options.any_tags.length > 20)
- ) {
- options.release_time = `>${Math.floor(moment().subtract(3, CS.FRESH_MONTH).startOf('week').unix())}`;
- } else if (
- (options.channel_ids && options.channel_ids.length > 10) ||
- (options.any_tags && options.any_tags.length > 10)
- ) {
- options.release_time = `>${Math.floor(moment().subtract(1, CS.FRESH_YEAR).startOf('week').unix())}`;
- } else {
- // Hack for at least the New page until https://github.com/lbryio/lbry-sdk/issues/2591 is fixed
- options.release_time = `<${Math.floor(moment().startOf('minute').unix())}`;
- }
+ // UPDATE: Commented out these lines of code to truly sort by oldest first...
+ //if (
+ // (options.channel_ids && options.channel_ids.length > 20) ||
+ // (options.any_tags && options.any_tags.length > 20)
+ //) {
+ // options.release_time = `>${Math.floor(moment().subtract(3, CS.FRESH_MONTH).startOf('week').unix())}`;
+ //} else if (
+ // (options.channel_ids && options.channel_ids.length > 10) ||
+ // (options.any_tags && options.any_tags.length > 10)
+ //) {
+ // options.release_time = `>${Math.floor(moment().subtract(1, CS.FRESH_YEAR).startOf('week').unix())}`;
+ //} else {
+ // // Hack for at least the New page until https://github.com/lbryio/lbry-sdk/issues/2591 is fixed
+ // options.release_time = `<${Math.floor(moment().startOf('minute').unix())}`;
+ //}
}
}
diff --git a/ui/component/claimListHeader/view.jsx b/ui/component/claimListHeader/view.jsx
index 91ac5b0e8..e12bf7cb4 100644
--- a/ui/component/claimListHeader/view.jsx
+++ b/ui/component/claimListHeader/view.jsx
@@ -67,6 +67,7 @@ function ClaimListHeader(props: Props) {
const [orderParamUser, setOrderParamUser] = usePersistedState(`orderUser-${location.pathname}`, CS.ORDER_BY_TRENDING);
const urlParams = new URLSearchParams(search);
const freshnessParam = freshness || urlParams.get(CS.FRESH_KEY) || defaultFreshness;
+ const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false); // UPDATE: Experimenting with hiding watched content
const contentTypeParam = urlParams.get(CS.CONTENT_KEY);
const streamTypeParam =
streamType || (CS.FILE_TYPES.includes(contentTypeParam) && contentTypeParam) || defaultStreamType || null;
@@ -97,7 +98,24 @@ function ClaimListHeader(props: Props) {
const shouldHighlight = searchInLanguage
? languageParam !== languageSetting && languageParam !== null
- : languageParam !== CS.LANGUAGES_ALL && languageParam !== null;
+ : languageParam !== CS.LANGUAGES_ALL && languageParam !== null;
+
+ // UPDATE: Experimenting with hiding watched content
+ // Adding a Hide Watched checkbox to the main menu
+ function getHideWatchedElem() {
+ return (
+
+ );
+ }
+
+ function updateSearchOptions(option, value) {
setSearchOption(option, value);
if (onSearchOptionsChanged) {
onSearchOptionsChanged(option);
@@ -149,7 +177,8 @@ const SearchOptions = (props: Props) => {
>
);
- const otherOptionsElem = (
+ // UPDATE: Changed element name to exactMatchElem
+ const exactMatchElem = (
<>
{
name="exact-match"
checked={options[SEARCH_OPTIONS.EXACT]}
onChange={() => updateSearchOptions(SEARCH_OPTIONS.EXACT, !options[SEARCH_OPTIONS.EXACT])}
- label={__('Exact match')}
/>
{
customTooltipText={__(
'Find results that include all the given words in the exact order.\nThis can also be done by surrounding the search query with quotation marks (e.g. "hello world").'
)}
- />
-