Remove hideFyp setting

This commit is contained in:
infinite-persistence 2022-03-23 19:48:45 +08:00 committed by Thomas Zarebczan
parent 5b16b3b058
commit ec5cd10ab1
6 changed files with 8 additions and 42 deletions

View file

@ -2146,9 +2146,13 @@
"Hide Scheduled Livestreams": "Hide Scheduled Livestreams",
"You will not see scheduled livestreams by people you follow on the home or following page.": "You will not see scheduled livestreams by people you follow on the home or following page.",
"Scheduled streams hidden, you can re-enable them in settings.": "Scheduled streams hidden, you can re-enable them in settings.",
"Hide Personal Recommendations": "Hide Personal Recommendations",
"Customize Homepage": "Customize Homepage",
"Customize --[Short label for \"Customize Homepage\"]--": "Customize",
"Sort and customize your homepage": "Sort and customize your homepage",
"Clean as a whistle! --[title for empty homepage]--": "Clean as a whistle!",
"You will not see the personal recommendations in the homepage.": "You will not see the personal recommendations in the homepage.",
"Hidden": "Hidden",
"Premium membership required. Become a member, or %learn_more%.": "Premium membership required. Become a member, or %learn_more%.",
"No recommendations available at the moment. %learn_more%": "No recommendations available at the moment. %learn_more%",
"Sorry, the service is currently unavailable.": "Sorry, the service is currently unavailable.",
"Started %time_date%": "Started %time_date%",
"Live %time_date%": "Live %time_date%",
@ -2158,6 +2162,7 @@
"Pinned": "Pinned",
"Remove all unavailable claims": "Remove all unavailable claims",
"Recommended For You": "Recommended For You",
"Recommended": "Recommended",
"Recommendation removed. Thanks for the feedback!": "Recommendation removed. Thanks for the feedback!",
"Hide Chat": "Hide Chat",
"Popout Chat": "Popout Chat",

View file

@ -3,11 +3,9 @@ import { selectMyChannelUrls } from 'redux/selectors/claims';
import * as SETTINGS from 'constants/settings';
import { doOpenModal } from 'redux/actions/app';
import { doSetPlayingUri } from 'redux/actions/content';
import { doFetchPersonalRecommendations } from 'redux/actions/search';
import { doSetClientSetting } from 'redux/actions/settings';
import { selectPersonalRecommendations } from 'redux/selectors/search';
import { selectShowMatureContent, selectClientSetting } from 'redux/selectors/settings';
import { selectHasOdyseeMembership, selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import SettingContent from './view';
@ -18,21 +16,17 @@ const select = (state) => ({
autoplayNext: selectClientSetting(state, SETTINGS.AUTOPLAY_NEXT),
hideReposts: selectClientSetting(state, SETTINGS.HIDE_REPOSTS),
hideScheduledLivestreams: selectClientSetting(state, SETTINGS.HIDE_SCHEDULED_LIVESTREAMS),
hideFyp: selectClientSetting(state, SETTINGS.HIDE_FYP),
showNsfw: selectShowMatureContent(state),
myChannelUrls: selectMyChannelUrls(state),
instantPurchaseEnabled: selectClientSetting(state, SETTINGS.INSTANT_PURCHASE_ENABLED),
instantPurchaseMax: selectClientSetting(state, SETTINGS.INSTANT_PURCHASE_MAX),
enablePublishPreview: selectClientSetting(state, SETTINGS.ENABLE_PUBLISH_PREVIEW),
hasMembership: selectHasOdyseeMembership(state),
personalRecommendations: selectPersonalRecommendations(state),
});
const perform = (dispatch) => ({
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
openModal: (id, params) => dispatch(doOpenModal(id, params)),
doFetchPersonalRecommendations: () => dispatch(doFetchPersonalRecommendations()),
});
export default connect(select, perform)(SettingContent);

View file

@ -27,18 +27,14 @@ type Props = {
hideReposts: ?boolean,
showNsfw: boolean,
hideScheduledLivestreams: boolean,
hideFyp: boolean,
myChannelUrls: ?Array<string>,
instantPurchaseEnabled: boolean,
instantPurchaseMax: Price,
enablePublishPreview: boolean,
hasMembership: ?boolean,
personalRecommendations: { gid: string, uris: Array<string> },
// --- perform ---
setClientSetting: (string, boolean | string | number) => void,
clearPlayingUri: () => void,
openModal: (string) => void,
doFetchPersonalRecommendations: () => void,
};
export default function SettingContent(props: Props) {
@ -50,27 +46,15 @@ export default function SettingContent(props: Props) {
hideReposts,
showNsfw,
hideScheduledLivestreams,
hideFyp,
myChannelUrls,
instantPurchaseEnabled,
instantPurchaseMax,
enablePublishPreview,
hasMembership,
personalRecommendations,
setClientSetting,
clearPlayingUri,
openModal,
doFetchPersonalRecommendations,
} = props;
const fypExists = personalRecommendations && personalRecommendations.uris.length > 0;
React.useEffect(() => {
if (hasMembership) {
doFetchPersonalRecommendations();
}
}, []);
return (
<>
<div className="card__title-section">
@ -135,20 +119,6 @@ export default function SettingContent(props: Props) {
/>
</SettingsRow>
<SettingsRow
membersOnly
title={__('Hide Personal Recommendations')}
subtitle={__(HELP.HIDE_FYP)}
disabled={!hasMembership || !fypExists}
>
<FormField
type="checkbox"
name="hide_fyp"
onChange={() => setClientSetting(SETTINGS.HIDE_FYP, !hideFyp)}
checked={hideFyp}
/>
</SettingsRow>
{!SIMPLE_SITE && (
<>
{/*

View file

@ -37,7 +37,6 @@ export const HOMEPAGE = 'homepage';
export const HOMEPAGE_ORDER = 'homepage_order';
export const HIDE_REPOSTS = 'hide_reposts';
export const HIDE_SCHEDULED_LIVESTREAMS = 'hide_scheduled_livestreams';
export const HIDE_FYP = 'hide_fyp';
export const SUPPORT_OPTION = 'support_option';
export const TILE_LAYOUT = 'tile_layout';
export const VIDEO_THEATER_MODE = 'video_theater_mode';

View file

@ -18,7 +18,6 @@ export const CLIENT_SYNC_KEYS = [
SETTINGS.SHOW_MATURE,
SETTINGS.HIDE_REPOSTS,
SETTINGS.HIDE_SCHEDULED_LIVESTREAMS,
SETTINGS.HIDE_FYP,
SETTINGS.SHOW_ANONYMOUS,
SETTINGS.INSTANT_PURCHASE_ENABLED,
SETTINGS.INSTANT_PURCHASE_MAX,

View file

@ -73,7 +73,6 @@ const defaultState = {
[SETTINGS.AUTO_DOWNLOAD]: true,
[SETTINGS.HIDE_REPOSTS]: false,
[SETTINGS.HIDE_SCHEDULED_LIVESTREAMS]: false,
[SETTINGS.HIDE_REPOSTS]: false,
// OS
[SETTINGS.AUTO_LAUNCH]: true,