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:
jessop 2020-04-15 12:43:22 -04:00 committed by Sean Yesmunt
parent acefad2827
commit a411ec9b47
11 changed files with 64 additions and 95 deletions

View file

@ -130,7 +130,7 @@
"imagesloaded": "^4.1.4", "imagesloaded": "^4.1.4",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git", "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", "lbryinc": "lbryio/lbryinc#cc62a4eec10845cc0b31da7d0f27287cfa7c4866",
"lint-staged": "^7.0.2", "lint-staged": "^7.0.2",
"localforage": "^1.7.1", "localforage": "^1.7.1",

View file

@ -1161,7 +1161,6 @@
"You have %count% blocked %channels%.": "You have %count% blocked %channels%.", "You have %count% blocked %channels%.": "You have %count% blocked %channels%.",
"Account Password": "Account Password", "Account Password": "Account Password",
"You do not currently have a password set.": "You do not currently have a password set.", "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", "Register with lbry.tv": "Register with lbry.tv",
"Enter Your lbry.tv Password": "Enter Your lbry.tv Password", "Enter Your lbry.tv Password": "Enter Your lbry.tv Password",
"Signing in as %email%": "Signing in as %email%", "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.", "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", "%follower_count% followers": "%follower_count% followers",
"%lbc_received% LBC Earned": "%lbc_received% LBC Earned", "%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.", "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."
}

View file

@ -16,7 +16,7 @@ const select = state => ({
claimSearchByQuery: selectClaimSearchByQuery(state), claimSearchByQuery: selectClaimSearchByQuery(state),
loading: selectFetchingClaimSearch(state), loading: selectFetchingClaimSearch(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state), showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
showReposts: makeSelectClientSetting(SETTINGS.SHOW_REPOSTS)(state), hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
hiddenUris: selectBlockedChannels(state), hiddenUris: selectBlockedChannels(state),
}); });
@ -25,7 +25,4 @@ const perform = {
doToggleTagFollowDesktop, doToggleTagFollowDesktop,
}; };
export default connect( export default connect(select, perform)(ClaimListDiscover);
select,
perform
)(ClaimListDiscover);

View file

@ -23,7 +23,7 @@ type Props = {
doToggleTagFollowDesktop: string => void, doToggleTagFollowDesktop: string => void,
meta?: Node, meta?: Node,
showNsfw: boolean, showNsfw: boolean,
// showReposts: boolean, hideReposts: boolean,
history: { action: string, push: string => void, replace: string => void }, history: { action: string, push: string => void, replace: string => void },
location: { search: string, pathname: string }, location: { search: string, pathname: string },
claimSearchByQuery: { claimSearchByQuery: {
@ -66,7 +66,7 @@ function ClaimListDiscover(props: Props) {
meta, meta,
channelIds, channelIds,
showNsfw, showNsfw,
// showReposts, hideReposts,
history, history,
location, location,
hiddenUris, hiddenUris,
@ -247,13 +247,16 @@ function ClaimListDiscover(props: Props) {
} }
} }
// https://github.com/lbryio/lbry-desktop/issues/3774 // https://github.com/lbryio/lbry-desktop/issues/3774
// if (!showReposts) { if (hideReposts && !options.reposted_claim_id) {
// if (Array.isArray(options.claim_type)) { // and not claimrepostid
// options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost'); if (Array.isArray(options.claim_type)) {
// } else { if (options.claim_type.length > 1) {
// options.claim_type = ['stream', 'channel']; 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 hasMatureTags = tagsParam && tagsParam.split(',').some(t => MATURE_TAGS.includes(t));
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options); const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);

View file

@ -14,7 +14,7 @@ const select = state => ({
claimSearchByQuery: selectClaimSearchByQuery(state), claimSearchByQuery: selectClaimSearchByQuery(state),
loading: selectFetchingClaimSearch(state), loading: selectFetchingClaimSearch(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state), showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
showReposts: makeSelectClientSetting(SETTINGS.SHOW_REPOSTS)(state), hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
hiddenUris: selectBlockedChannels(state), hiddenUris: selectBlockedChannels(state),
}); });
@ -23,7 +23,4 @@ const perform = {
doToggleTagFollowDesktop, doToggleTagFollowDesktop,
}; };
export default connect( export default connect(select, perform)(ClaimListDiscover);
select,
perform
)(ClaimListDiscover);

View file

@ -8,7 +8,7 @@ type Props = {
uris: Array<string>, uris: Array<string>,
doClaimSearch: ({}) => void, doClaimSearch: ({}) => void,
showNsfw: boolean, showNsfw: boolean,
showReposts: boolean, hideReposts: boolean,
history: { action: string, push: string => void, replace: string => void }, history: { action: string, push: string => void, replace: string => void },
claimSearchByQuery: { claimSearchByQuery: {
[string]: Array<string>, [string]: Array<string>,
@ -30,7 +30,7 @@ function ClaimTilesDiscover(props: Props) {
doClaimSearch, doClaimSearch,
claimSearchByQuery, claimSearchByQuery,
showNsfw, showNsfw,
// showReposts, hideReposts,
hiddenUris, hiddenUris,
// Below are options to pass that are forwarded to claim_search // Below are options to pass that are forwarded to claim_search
tags, tags,
@ -77,13 +77,13 @@ function ClaimTilesDiscover(props: Props) {
} }
// https://github.com/lbryio/lbry-desktop/issues/3774 // https://github.com/lbryio/lbry-desktop/issues/3774
// if (!showReposts) { if (hideReposts) {
// if (Array.isArray(options.claim_type)) { if (Array.isArray(options.claim_type)) {
// options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost'); options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
// } else { } else {
// options.claim_type = ['stream', 'channel']; options.claim_type = ['stream', 'channel'];
// } }
// } }
if (claimType) { if (claimType) {
options.claim_type = claimType; options.claim_type = claimType;

View file

@ -44,7 +44,7 @@ const select = state => ({
userBlockedChannelsCount: selectBlockedChannelsCount(state), userBlockedChannelsCount: selectBlockedChannelsCount(state),
hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state), hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state),
floatingPlayer: makeSelectClientSetting(SETTINGS.FLOATING_PLAYER)(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), darkModeTimes: makeSelectClientSetting(SETTINGS.DARK_MODE_TIMES)(state),
ffmpegStatus: selectFfmpegStatus(state), ffmpegStatus: selectFfmpegStatus(state),
findingFFmpeg: selectFindingFFmpeg(state), findingFFmpeg: selectFindingFFmpeg(state),
@ -65,7 +65,4 @@ const perform = dispatch => ({
findFFmpeg: () => dispatch(doFindFFmpeg()), findFFmpeg: () => dispatch(doFindFFmpeg()),
}); });
export default connect( export default connect(select, perform)(SettingsPage);
select,
perform
)(SettingsPage);

View file

@ -19,6 +19,7 @@ import Card from 'component/common/card';
import { getPasswordFromCookie } from 'util/saved-passwords'; import { getPasswordFromCookie } from 'util/saved-passwords';
import Spinner from 'component/spinner'; import Spinner from 'component/spinner';
import SettingAccountPassword from 'component/settingAccountPassword'; import SettingAccountPassword from 'component/settingAccountPassword';
import { Lbryio } from 'lbryinc';
// @if TARGET='app' // @if TARGET='app'
export const IS_MAC = process.platform === 'darwin'; export const IS_MAC = process.platform === 'darwin';
@ -78,7 +79,7 @@ type Props = {
hideBalance: boolean, hideBalance: boolean,
confirmForgetPassword: ({}) => void, confirmForgetPassword: ({}) => void,
floatingPlayer: boolean, floatingPlayer: boolean,
// showReposts: boolean, hideReposts: boolean,
clearPlayingUri: () => void, clearPlayingUri: () => void,
darkModeTimes: DarkModeTimes, darkModeTimes: DarkModeTimes,
setDarkTime: (string, {}) => void, setDarkTime: (string, {}) => void,
@ -240,7 +241,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
hideBalance, hideBalance,
userBlockedChannelsCount, userBlockedChannelsCount,
floatingPlayer, floatingPlayer,
// showReposts, hideReposts,
clearPlayingUri, clearPlayingUri,
darkModeTimes, darkModeTimes,
clearCache, clearCache,
@ -434,16 +435,21 @@ class SettingsPage extends React.PureComponent<Props, State> {
/> />
{/* https://github.com/lbryio/lbry-desktop/issues/3774 */} {/* https://github.com/lbryio/lbry-desktop/issues/3774 */}
{/* <FormField <FormField
type="checkbox" type="checkbox"
name="show_reposts" name="hide_reposts"
onChange={() => { onChange={e => {
setClientSetting(SETTINGS.SHOW_REPOSTS, !showReposts); 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} checked={hideReposts}
label={__('Show reposts')} label={__('Hide reposts')}
helper={__('Show reposts from the creators you follow.')} helper={__('You will not see reposts by people you follow or receive email notifying about them.')}
/> */} />
{/* <FormField {/* <FormField
type="checkbox" type="checkbox"

View file

@ -53,7 +53,7 @@ const defaultState = {
[SETTINGS.AUTOPLAY]: true, [SETTINGS.AUTOPLAY]: true,
[SETTINGS.FLOATING_PLAYER]: true, [SETTINGS.FLOATING_PLAYER]: true,
[SETTINGS.AUTO_DOWNLOAD]: true, [SETTINGS.AUTO_DOWNLOAD]: true,
[SETTINGS.SHOW_REPOSTS]: true, [SETTINGS.HIDE_REPOSTS]: false,
// OS // OS
[SETTINGS.AUTO_LAUNCH]: true, [SETTINGS.AUTO_LAUNCH]: true,

View file

@ -4,70 +4,37 @@ import { createSelector } from 'reselect';
const selectState = state => state.settings || {}; const selectState = state => state.settings || {};
export const selectDaemonSettings = createSelector( export const selectDaemonSettings = createSelector(selectState, state => state.daemonSettings);
selectState,
state => state.daemonSettings
);
export const selectDaemonStatus = createSelector( export const selectDaemonStatus = createSelector(selectState, state => state.daemonStatus);
selectState,
state => state.daemonStatus
);
export const selectFfmpegStatus = createSelector( export const selectFfmpegStatus = createSelector(selectDaemonStatus, status => status.ffmpeg_status);
selectDaemonStatus,
status => status.ffmpeg_status
);
export const selectFindingFFmpeg = createSelector( export const selectFindingFFmpeg = createSelector(selectState, state => state.findingFFmpeg || false);
selectState,
state => state.findingFFmpeg || false
);
export const selectClientSettings = createSelector( export const selectClientSettings = createSelector(selectState, state => state.clientSettings || {});
selectState,
state => state.clientSettings || {}
);
export const selectLoadedLanguages = createSelector( export const selectLoadedLanguages = createSelector(selectState, state => state.loadedLanguages || {});
selectState,
state => state.loadedLanguages || {}
);
export const makeSelectClientSetting = setting => export const makeSelectClientSetting = setting =>
createSelector( createSelector(selectClientSettings, settings => (settings ? settings[setting] : undefined));
selectClientSettings,
settings => (settings ? settings[setting] : undefined)
);
// refactor me // refactor me
export const selectShowMatureContent = makeSelectClientSetting(LBRY_REDUX_SETTINGS.SHOW_MATURE); export const selectShowMatureContent = makeSelectClientSetting(LBRY_REDUX_SETTINGS.SHOW_MATURE);
// and me // 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 selectTheme = makeSelectClientSetting(SETTINGS.THEME);
export const selectAutomaticDarkModeEnabled = makeSelectClientSetting(SETTINGS.AUTOMATIC_DARK_MODE_ENABLED); export const selectAutomaticDarkModeEnabled = makeSelectClientSetting(SETTINGS.AUTOMATIC_DARK_MODE_ENABLED);
export const selectIsNight = createSelector( export const selectIsNight = createSelector(selectState, state => state.isNight);
selectState,
state => state.isNight
);
export const selectSavedWalletServers = createSelector( export const selectSavedWalletServers = createSelector(selectState, state => state.customWalletServers);
selectState,
state => state.customWalletServers
);
export const selectSharedPreferences = createSelector( export const selectSharedPreferences = createSelector(selectState, state => state.sharedPreferences);
selectState,
state => state.sharedPreferences
);
export const makeSelectSharedPreferencesForKey = key => export const makeSelectSharedPreferencesForKey = key =>
createSelector( createSelector(selectSharedPreferences, prefs => (prefs ? prefs[key] : undefined));
selectSharedPreferences,
prefs => (prefs ? prefs[key] : undefined)
);
export const selectHasWalletServerPrefs = createSelector( export const selectHasWalletServerPrefs = createSelector(
makeSelectSharedPreferencesForKey(SHARED_PREFERENCES.WALLET_SERVERS), makeSelectSharedPreferencesForKey(SHARED_PREFERENCES.WALLET_SERVERS),

View file

@ -6132,9 +6132,9 @@ lazy-val@^1.0.4:
yargs "^13.2.2" yargs "^13.2.2"
zstd-codec "^0.1.1" zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#ce642bbae6a4647e4be77586b6307d6069006776: lbry-redux@lbryio/lbry-redux#17f611888c60b71910b5b984a05c5ef6eef4d5dc:
version "0.0.1" 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: dependencies:
proxy-polyfill "0.1.6" proxy-polyfill "0.1.6"
reselect "^3.0.0" reselect "^3.0.0"