reenable reposts
reenable reposts and track for emails review changes change showReposts to hideReposts due to persist hydrate issue bugfix bugfix
This commit is contained in:
parent
acefad2827
commit
a411ec9b47
11 changed files with 64 additions and 95 deletions
|
@ -130,7 +130,7 @@
|
|||
"imagesloaded": "^4.1.4",
|
||||
"json-loader": "^0.5.4",
|
||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||
"lbry-redux": "lbryio/lbry-redux#ce642bbae6a4647e4be77586b6307d6069006776",
|
||||
"lbry-redux": "lbryio/lbry-redux#17f611888c60b71910b5b984a05c5ef6eef4d5dc",
|
||||
"lbryinc": "lbryio/lbryinc#cc62a4eec10845cc0b31da7d0f27287cfa7c4866",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
|
|
|
@ -1161,7 +1161,6 @@
|
|||
"You have %count% blocked %channels%.": "You have %count% blocked %channels%.",
|
||||
"Account Password": "Account Password",
|
||||
"You do not currently have a password set.": "You do not currently have a password set.",
|
||||
"Add A Password": "Add A Password",
|
||||
"Register with lbry.tv": "Register with lbry.tv",
|
||||
"Enter Your lbry.tv Password": "Enter Your lbry.tv Password",
|
||||
"Signing in as %email%": "Signing in as %email%",
|
||||
|
@ -1191,6 +1190,9 @@
|
|||
"There are no stats for this channel. Make sure you are signed in with the correct email and have data sharing turned on.": "There are no stats for this channel. Make sure you are signed in with the correct email and have data sharing turned on.",
|
||||
"%follower_count% followers": "%follower_count% followers",
|
||||
"%lbc_received% LBC Earned": "%lbc_received% LBC Earned",
|
||||
"Sign Up": "Sign Up",
|
||||
"Earnings may also include any LBC you've sent yourself or added as support. We are working on making this more accurate. Check your wallet page for the correct total balance.": "Earnings may also include any LBC you've sent yourself or added as support. We are working on making this more accurate. Check your wallet page for the correct total balance.",
|
||||
"Sign Up": "Sign Up"
|
||||
}
|
||||
"Add A Password": "Add A Password",
|
||||
"Hide reposts": "Hide reposts",
|
||||
"You will not see reposts by people you follow or receive email notifying about them.": "You will not see reposts by people you follow or receive email notifying about them."
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ const select = state => ({
|
|||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
showReposts: makeSelectClientSetting(SETTINGS.SHOW_REPOSTS)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
hiddenUris: selectBlockedChannels(state),
|
||||
});
|
||||
|
||||
|
@ -25,7 +25,4 @@ const perform = {
|
|||
doToggleTagFollowDesktop,
|
||||
};
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(ClaimListDiscover);
|
||||
export default connect(select, perform)(ClaimListDiscover);
|
||||
|
|
|
@ -23,7 +23,7 @@ type Props = {
|
|||
doToggleTagFollowDesktop: string => void,
|
||||
meta?: Node,
|
||||
showNsfw: boolean,
|
||||
// showReposts: boolean,
|
||||
hideReposts: boolean,
|
||||
history: { action: string, push: string => void, replace: string => void },
|
||||
location: { search: string, pathname: string },
|
||||
claimSearchByQuery: {
|
||||
|
@ -66,7 +66,7 @@ function ClaimListDiscover(props: Props) {
|
|||
meta,
|
||||
channelIds,
|
||||
showNsfw,
|
||||
// showReposts,
|
||||
hideReposts,
|
||||
history,
|
||||
location,
|
||||
hiddenUris,
|
||||
|
@ -247,13 +247,16 @@ function ClaimListDiscover(props: Props) {
|
|||
}
|
||||
}
|
||||
// https://github.com/lbryio/lbry-desktop/issues/3774
|
||||
// if (!showReposts) {
|
||||
// if (Array.isArray(options.claim_type)) {
|
||||
// options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
||||
// } else {
|
||||
// options.claim_type = ['stream', 'channel'];
|
||||
// }
|
||||
// }
|
||||
if (hideReposts && !options.reposted_claim_id) {
|
||||
// and not claimrepostid
|
||||
if (Array.isArray(options.claim_type)) {
|
||||
if (options.claim_type.length > 1) {
|
||||
options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
||||
}
|
||||
} else {
|
||||
options.claim_type = ['stream', 'channel'];
|
||||
}
|
||||
}
|
||||
|
||||
const hasMatureTags = tagsParam && tagsParam.split(',').some(t => MATURE_TAGS.includes(t));
|
||||
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
|
||||
|
|
|
@ -14,7 +14,7 @@ const select = state => ({
|
|||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
showReposts: makeSelectClientSetting(SETTINGS.SHOW_REPOSTS)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
hiddenUris: selectBlockedChannels(state),
|
||||
});
|
||||
|
||||
|
@ -23,7 +23,4 @@ const perform = {
|
|||
doToggleTagFollowDesktop,
|
||||
};
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(ClaimListDiscover);
|
||||
export default connect(select, perform)(ClaimListDiscover);
|
||||
|
|
|
@ -8,7 +8,7 @@ type Props = {
|
|||
uris: Array<string>,
|
||||
doClaimSearch: ({}) => void,
|
||||
showNsfw: boolean,
|
||||
showReposts: boolean,
|
||||
hideReposts: boolean,
|
||||
history: { action: string, push: string => void, replace: string => void },
|
||||
claimSearchByQuery: {
|
||||
[string]: Array<string>,
|
||||
|
@ -30,7 +30,7 @@ function ClaimTilesDiscover(props: Props) {
|
|||
doClaimSearch,
|
||||
claimSearchByQuery,
|
||||
showNsfw,
|
||||
// showReposts,
|
||||
hideReposts,
|
||||
hiddenUris,
|
||||
// Below are options to pass that are forwarded to claim_search
|
||||
tags,
|
||||
|
@ -77,13 +77,13 @@ function ClaimTilesDiscover(props: Props) {
|
|||
}
|
||||
|
||||
// https://github.com/lbryio/lbry-desktop/issues/3774
|
||||
// if (!showReposts) {
|
||||
// if (Array.isArray(options.claim_type)) {
|
||||
// options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
||||
// } else {
|
||||
// options.claim_type = ['stream', 'channel'];
|
||||
// }
|
||||
// }
|
||||
if (hideReposts) {
|
||||
if (Array.isArray(options.claim_type)) {
|
||||
options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
||||
} else {
|
||||
options.claim_type = ['stream', 'channel'];
|
||||
}
|
||||
}
|
||||
|
||||
if (claimType) {
|
||||
options.claim_type = claimType;
|
||||
|
|
|
@ -44,7 +44,7 @@ const select = state => ({
|
|||
userBlockedChannelsCount: selectBlockedChannelsCount(state),
|
||||
hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state),
|
||||
floatingPlayer: makeSelectClientSetting(SETTINGS.FLOATING_PLAYER)(state),
|
||||
showReposts: makeSelectClientSetting(SETTINGS.SHOW_REPOSTS)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
darkModeTimes: makeSelectClientSetting(SETTINGS.DARK_MODE_TIMES)(state),
|
||||
ffmpegStatus: selectFfmpegStatus(state),
|
||||
findingFFmpeg: selectFindingFFmpeg(state),
|
||||
|
@ -65,7 +65,4 @@ const perform = dispatch => ({
|
|||
findFFmpeg: () => dispatch(doFindFFmpeg()),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(SettingsPage);
|
||||
export default connect(select, perform)(SettingsPage);
|
||||
|
|
|
@ -19,6 +19,7 @@ import Card from 'component/common/card';
|
|||
import { getPasswordFromCookie } from 'util/saved-passwords';
|
||||
import Spinner from 'component/spinner';
|
||||
import SettingAccountPassword from 'component/settingAccountPassword';
|
||||
import { Lbryio } from 'lbryinc';
|
||||
|
||||
// @if TARGET='app'
|
||||
export const IS_MAC = process.platform === 'darwin';
|
||||
|
@ -78,7 +79,7 @@ type Props = {
|
|||
hideBalance: boolean,
|
||||
confirmForgetPassword: ({}) => void,
|
||||
floatingPlayer: boolean,
|
||||
// showReposts: boolean,
|
||||
hideReposts: boolean,
|
||||
clearPlayingUri: () => void,
|
||||
darkModeTimes: DarkModeTimes,
|
||||
setDarkTime: (string, {}) => void,
|
||||
|
@ -240,7 +241,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
|||
hideBalance,
|
||||
userBlockedChannelsCount,
|
||||
floatingPlayer,
|
||||
// showReposts,
|
||||
hideReposts,
|
||||
clearPlayingUri,
|
||||
darkModeTimes,
|
||||
clearCache,
|
||||
|
@ -434,16 +435,21 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
|||
/>
|
||||
|
||||
{/* https://github.com/lbryio/lbry-desktop/issues/3774 */}
|
||||
{/* <FormField
|
||||
<FormField
|
||||
type="checkbox"
|
||||
name="show_reposts"
|
||||
onChange={() => {
|
||||
setClientSetting(SETTINGS.SHOW_REPOSTS, !showReposts);
|
||||
name="hide_reposts"
|
||||
onChange={e => {
|
||||
if (isAuthenticated) {
|
||||
let param = e.target.checked ? { add: 'noreposts' } : { remove: 'noreposts' };
|
||||
Lbryio.call('user_tag', 'edit', param);
|
||||
}
|
||||
// $FlowFixMe could be undefined due to rehydrate
|
||||
setClientSetting(SETTINGS.HIDE_REPOSTS, !Boolean(hideReposts));
|
||||
}}
|
||||
checked={showReposts}
|
||||
label={__('Show reposts')}
|
||||
helper={__('Show reposts from the creators you follow.')}
|
||||
/> */}
|
||||
checked={hideReposts}
|
||||
label={__('Hide reposts')}
|
||||
helper={__('You will not see reposts by people you follow or receive email notifying about them.')}
|
||||
/>
|
||||
|
||||
{/* <FormField
|
||||
type="checkbox"
|
||||
|
|
|
@ -53,7 +53,7 @@ const defaultState = {
|
|||
[SETTINGS.AUTOPLAY]: true,
|
||||
[SETTINGS.FLOATING_PLAYER]: true,
|
||||
[SETTINGS.AUTO_DOWNLOAD]: true,
|
||||
[SETTINGS.SHOW_REPOSTS]: true,
|
||||
[SETTINGS.HIDE_REPOSTS]: false,
|
||||
|
||||
// OS
|
||||
[SETTINGS.AUTO_LAUNCH]: true,
|
||||
|
|
|
@ -4,70 +4,37 @@ import { createSelector } from 'reselect';
|
|||
|
||||
const selectState = state => state.settings || {};
|
||||
|
||||
export const selectDaemonSettings = createSelector(
|
||||
selectState,
|
||||
state => state.daemonSettings
|
||||
);
|
||||
export const selectDaemonSettings = createSelector(selectState, state => state.daemonSettings);
|
||||
|
||||
export const selectDaemonStatus = createSelector(
|
||||
selectState,
|
||||
state => state.daemonStatus
|
||||
);
|
||||
export const selectDaemonStatus = createSelector(selectState, state => state.daemonStatus);
|
||||
|
||||
export const selectFfmpegStatus = createSelector(
|
||||
selectDaemonStatus,
|
||||
status => status.ffmpeg_status
|
||||
);
|
||||
export const selectFfmpegStatus = createSelector(selectDaemonStatus, status => status.ffmpeg_status);
|
||||
|
||||
export const selectFindingFFmpeg = createSelector(
|
||||
selectState,
|
||||
state => state.findingFFmpeg || false
|
||||
);
|
||||
export const selectFindingFFmpeg = createSelector(selectState, state => state.findingFFmpeg || false);
|
||||
|
||||
export const selectClientSettings = createSelector(
|
||||
selectState,
|
||||
state => state.clientSettings || {}
|
||||
);
|
||||
export const selectClientSettings = createSelector(selectState, state => state.clientSettings || {});
|
||||
|
||||
export const selectLoadedLanguages = createSelector(
|
||||
selectState,
|
||||
state => state.loadedLanguages || {}
|
||||
);
|
||||
export const selectLoadedLanguages = createSelector(selectState, state => state.loadedLanguages || {});
|
||||
|
||||
export const makeSelectClientSetting = setting =>
|
||||
createSelector(
|
||||
selectClientSettings,
|
||||
settings => (settings ? settings[setting] : undefined)
|
||||
);
|
||||
createSelector(selectClientSettings, settings => (settings ? settings[setting] : undefined));
|
||||
|
||||
// refactor me
|
||||
export const selectShowMatureContent = makeSelectClientSetting(LBRY_REDUX_SETTINGS.SHOW_MATURE);
|
||||
|
||||
// and me
|
||||
export const selectShowRepostedContent = makeSelectClientSetting(LBRY_REDUX_SETTINGS.SHOW_REPOSTS);
|
||||
export const selectShowRepostedContent = makeSelectClientSetting(LBRY_REDUX_SETTINGS.HIDE_REPOSTS);
|
||||
|
||||
export const selectTheme = makeSelectClientSetting(SETTINGS.THEME);
|
||||
export const selectAutomaticDarkModeEnabled = makeSelectClientSetting(SETTINGS.AUTOMATIC_DARK_MODE_ENABLED);
|
||||
export const selectIsNight = createSelector(
|
||||
selectState,
|
||||
state => state.isNight
|
||||
);
|
||||
export const selectIsNight = createSelector(selectState, state => state.isNight);
|
||||
|
||||
export const selectSavedWalletServers = createSelector(
|
||||
selectState,
|
||||
state => state.customWalletServers
|
||||
);
|
||||
export const selectSavedWalletServers = createSelector(selectState, state => state.customWalletServers);
|
||||
|
||||
export const selectSharedPreferences = createSelector(
|
||||
selectState,
|
||||
state => state.sharedPreferences
|
||||
);
|
||||
export const selectSharedPreferences = createSelector(selectState, state => state.sharedPreferences);
|
||||
|
||||
export const makeSelectSharedPreferencesForKey = key =>
|
||||
createSelector(
|
||||
selectSharedPreferences,
|
||||
prefs => (prefs ? prefs[key] : undefined)
|
||||
);
|
||||
createSelector(selectSharedPreferences, prefs => (prefs ? prefs[key] : undefined));
|
||||
|
||||
export const selectHasWalletServerPrefs = createSelector(
|
||||
makeSelectSharedPreferencesForKey(SHARED_PREFERENCES.WALLET_SERVERS),
|
||||
|
|
|
@ -6132,9 +6132,9 @@ lazy-val@^1.0.4:
|
|||
yargs "^13.2.2"
|
||||
zstd-codec "^0.1.1"
|
||||
|
||||
lbry-redux@lbryio/lbry-redux#ce642bbae6a4647e4be77586b6307d6069006776:
|
||||
lbry-redux@lbryio/lbry-redux#17f611888c60b71910b5b984a05c5ef6eef4d5dc:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/ce642bbae6a4647e4be77586b6307d6069006776"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/17f611888c60b71910b5b984a05c5ef6eef4d5dc"
|
||||
dependencies:
|
||||
proxy-polyfill "0.1.6"
|
||||
reselect "^3.0.0"
|
||||
|
|
Loading…
Reference in a new issue