Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c616296353 |
No files matched your search
@@ -104,8 +104,6 @@ jobs:
|
||||
name: Windows
|
||||
path: ./dist/electron/*.*
|
||||
- uses: jakejarvis/s3-sync-action@master
|
||||
if: |
|
||||
startsWith(runner.os, 'linux')
|
||||
with:
|
||||
args: --acl public-read --follow-symlinks --exclude '*' --include '*.deb' --include '*.AppImage' --include '*.dmg'
|
||||
env:
|
||||
|
||||
+4
-11
@@ -10,16 +10,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Mac <= 10.13 (High Sierra) and Ubuntu <= 16 (Xenial) are no longer supported. If you upgrade, you will need to manually build and install your own lbrynet SDK
|
||||
|
||||
### Added
|
||||
- Direct replying to notifications _community pr!_ ([#6935](https://github.com/lbryio/lbry-desktop/pull/6935))
|
||||
- Added direct replying to notifications _community pr!_ ([#6935](https://github.com/lbryio/lbry-desktop/pull/6935))
|
||||
- Added "Replay" option on autoplay countdown ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
|
||||
- Added "Loop" option on Lists ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
|
||||
- Added "Shuffle" option on Lists ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
|
||||
- Added Play Next/Previous buttons (with shortcuts SHIFT+N/SHIFT+P) ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
|
||||
- Separate control for autoplay next on video player ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
|
||||
- Channel Mention selection ability while creating a comment ([#7151](https://github.com/lbryio/lbry-desktop/pull/7151))
|
||||
- Disk space setting under Data Hosting ([#7266](https://github.com/lbryio/lbry-desktop/pull/7266))
|
||||
- Paginated 'All Playlists' page ([#7268](https://github.com/lbryio/lbry-desktop/pull/7268))
|
||||
- Expanded playlist ordering tools ([#7305](https://github.com/lbryio/lbry-desktop/pull/7305))
|
||||
- Added separate control for autoplay next on video player ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
|
||||
- Added Channel Mention selection ability while creating a comment ([#7151](https://github.com/lbryio/lbry-desktop/pull/7151))
|
||||
|
||||
### Changed
|
||||
- Changing the supported language from Filipino to Tagalog _community pr!_ ([#6951](https://github.com/lbryio/lbry-desktop/pull/6951))
|
||||
@@ -29,10 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Styling cleanup for file reactions ([#7251](https://github.com/lbryio/lbry-desktop/pull/7251))
|
||||
- Change share url to odysee and allow custom share url in settings ([#7258](https://github.com/lbryio/lbry-desktop/pull/7258))
|
||||
- Change Sign in/up to Cloud Connect for Odysee ([#7260](https://github.com/lbryio/lbry-desktop/pull/7260))
|
||||
- Upgraded to lbrynet v0.106.0 ([#7315](https://github.com/lbryio/lbry-desktop/pull/7315))
|
||||
- Upgraded Electron to v11.5.0 ([#7276](https://github.com/lbryio/lbry-desktop/pull/7276))
|
||||
- Cleaner Discover page filters ([#7306](https://github.com/lbryio/lbry-desktop/pull/7306))
|
||||
- Scroll bar styling ([#7314](https://github.com/lbryio/lbry-desktop/pull/7314))
|
||||
- Upgraded to lbrynet v0.103.0 ([#7265](https://github.com/lbryio/lbry-desktop/pull/7265))
|
||||
|
||||
### Fixed
|
||||
- Clicking on the title of a floating player will take you back to the list ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
|
||||
@@ -42,7 +36,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Fix playlist preview thumbnail ([#7178](https://github.com/lbryio/lbry-desktop/pull/7178)
|
||||
- Fixed “Your Account” popup on mobile ([#7172](https://github.com/lbryio/lbry-desktop/pull/7172))
|
||||
- Fix disable-support for comments ([#7245](https://github.com/lbryio/lbry-desktop/pull/7245))
|
||||
- Fix Electron taking over .html files on linux ([#7291](https://github.com/lbryio/lbry-desktop/pull/7291))
|
||||
|
||||
## [0.51.2] - [2021-08-20]
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
}
|
||||
},
|
||||
"deb": {
|
||||
"depends": ["gconf2", "gconf-service", "libnotify4", "libxtst6", "libnss3"]
|
||||
"depends": ["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3"]
|
||||
},
|
||||
"nsis": {
|
||||
"perMachine": true,
|
||||
|
||||
Vendored
-1
@@ -45,7 +45,6 @@ declare type CommentsState = {
|
||||
isLoading: boolean,
|
||||
isLoadingById: boolean,
|
||||
isLoadingByParentId: { [string]: boolean },
|
||||
isCommenting: boolean,
|
||||
myComments: ?Set<string>,
|
||||
isFetchingReacts: boolean,
|
||||
myReactsByCommentId: ?{ [string]: Array<string> }, // {"CommentId:MyChannelId": ["like", "dislike", ...]}
|
||||
|
||||
Vendored
-43
@@ -91,46 +91,3 @@ declare type NotificationState = {
|
||||
errors: Array<ErrorNotification>,
|
||||
toasts: Array<Toast>,
|
||||
};
|
||||
|
||||
declare type WebNotification = {
|
||||
active_at: string,
|
||||
created_at: string,
|
||||
id: number,
|
||||
is_app_readable: boolean,
|
||||
is_device_notified: boolean,
|
||||
is_emailed: boolean,
|
||||
is_read: boolean,
|
||||
is_seen: boolean,
|
||||
notification_parameters: {
|
||||
device: {
|
||||
analytics_label: string,
|
||||
image_url: string,
|
||||
is_data_only: boolean,
|
||||
name: string,
|
||||
placeholders: ?string,
|
||||
target: string,
|
||||
text: string,
|
||||
title: string,
|
||||
type: string,
|
||||
},
|
||||
dynamic: {
|
||||
comment_author: string,
|
||||
reply_author: string,
|
||||
hash: string,
|
||||
claim_title: string,
|
||||
comment?: string,
|
||||
channel_url: string,
|
||||
},
|
||||
email: {},
|
||||
},
|
||||
notification_rule: string,
|
||||
type: string,
|
||||
updated_at: string,
|
||||
user_id: number,
|
||||
group_count?: number,
|
||||
};
|
||||
|
||||
declare type NotificationCategory = {
|
||||
name: string,
|
||||
types: ?Array<string>,
|
||||
};
|
||||
Vendored
+1
-28
@@ -11,44 +11,17 @@ declare type UpdatePublishFormData = {
|
||||
thumbnail_url?: string,
|
||||
uploadThumbnailStatus?: string,
|
||||
thumbnailPath?: string,
|
||||
thumbnailError?: boolean,
|
||||
description?: string,
|
||||
language?: string,
|
||||
channel?: string,
|
||||
channelId?: string,
|
||||
name?: string,
|
||||
nameError?: string,
|
||||
bid?: number,
|
||||
bid?: string,
|
||||
bidError?: string,
|
||||
otherLicenseDescription?: string,
|
||||
licenseUrl?: string,
|
||||
licenseType?: string,
|
||||
uri?: string,
|
||||
nsfw: boolean,
|
||||
isMarkdownPost?: boolean,
|
||||
};
|
||||
|
||||
declare type PublishParams = {
|
||||
name: ?string,
|
||||
bid: ?number,
|
||||
filePath?: string,
|
||||
description: ?string,
|
||||
language: string,
|
||||
publishingLicense?: string,
|
||||
publishingLicenseUrl?: string,
|
||||
thumbnail: ?string,
|
||||
channel: string,
|
||||
channelId?: string,
|
||||
title: string,
|
||||
contentIsFree: boolean,
|
||||
uri?: string,
|
||||
license: ?string,
|
||||
licenseUrl: ?string,
|
||||
fee?: {
|
||||
amount: string,
|
||||
currency: string,
|
||||
},
|
||||
claim: StreamClaim,
|
||||
nsfw: boolean,
|
||||
tags: Array<Tag>,
|
||||
};
|
||||
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
// @flow
|
||||
declare type WebNotification = {
|
||||
active_at: string,
|
||||
created_at: string,
|
||||
id: number,
|
||||
is_app_readable: boolean,
|
||||
is_device_notified: boolean,
|
||||
is_emailed: boolean,
|
||||
is_read: boolean,
|
||||
is_seen: boolean,
|
||||
notification_parameters: {
|
||||
device: {
|
||||
analytics_label: string,
|
||||
image_url: string,
|
||||
is_data_only: boolean,
|
||||
name: string,
|
||||
placeholders: ?string,
|
||||
target: string,
|
||||
text: string,
|
||||
title: string,
|
||||
type: string,
|
||||
},
|
||||
dynamic: {
|
||||
comment_author: string,
|
||||
reply_author: string,
|
||||
hash: string,
|
||||
claim_title: string,
|
||||
comment?: string,
|
||||
channel_url: string,
|
||||
},
|
||||
email: {},
|
||||
},
|
||||
notification_rule: string,
|
||||
type: string,
|
||||
updated_at: string,
|
||||
user_id: number,
|
||||
group_count?: number,
|
||||
};
|
||||
|
||||
declare type NotificationCategory = {
|
||||
name: string,
|
||||
types: ?Array<string>,
|
||||
};
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// @flow
|
||||
|
||||
declare type UpdatePublishFormData = {
|
||||
filePath?: string,
|
||||
contentIsFree?: boolean,
|
||||
fee?: {
|
||||
amount: string,
|
||||
currency: string,
|
||||
},
|
||||
title?: string,
|
||||
thumbnail_url?: string,
|
||||
uploadThumbnailStatus?: string,
|
||||
thumbnailPath?: string,
|
||||
description?: string,
|
||||
language?: string,
|
||||
channel?: string,
|
||||
channelId?: string,
|
||||
name?: string,
|
||||
nameError?: string,
|
||||
bid?: string,
|
||||
bidError?: string,
|
||||
otherLicenseDescription?: string,
|
||||
licenseUrl?: string,
|
||||
licenseType?: string,
|
||||
uri?: string,
|
||||
nsfw: boolean,
|
||||
};
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
declare type Dispatch = any;
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lbry",
|
||||
"version": "0.52.0-rc.7",
|
||||
"version": "0.52.0-rc.5",
|
||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||
"keywords": [
|
||||
"lbry"
|
||||
@@ -56,7 +56,6 @@
|
||||
"match-sorter": "^6.3.0",
|
||||
"parse-duration": "^1.0.0",
|
||||
"proxy-polyfill": "0.1.6",
|
||||
"re-reselect": "^4.0.0",
|
||||
"react-datetime-picker": "^3.2.1",
|
||||
"react-plastic": "^1.1.1",
|
||||
"react-top-loading-bar": "^2.0.1",
|
||||
@@ -238,7 +237,7 @@
|
||||
"yarn": "^1.3"
|
||||
},
|
||||
"lbrySettings": {
|
||||
"lbrynetDaemonVersion": "0.106.0",
|
||||
"lbrynetDaemonVersion": "0.103.0",
|
||||
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
|
||||
"lbrynetDaemonDir": "static/daemon",
|
||||
"lbrynetDaemonFileName": "lbrynet"
|
||||
|
||||
@@ -2220,7 +2220,5 @@
|
||||
"filtered": "filtered",
|
||||
"View All Playlists": "View All Playlists",
|
||||
"Your wallet is not currently using a cloud sync service. You are in control of backing up your wallet.": "Your wallet is not currently using a cloud sync service. You are in control of backing up your wallet.",
|
||||
"Sending": "Sending",
|
||||
"You sent %lbc%": "You sent %lbc%",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
@@ -4,12 +4,12 @@ import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
||||
import { withRouter } from 'react-router';
|
||||
import { makeSelectClaimForUri } from 'redux/selectors/claims';
|
||||
import { doResolveUris } from 'redux/actions/claims';
|
||||
import { selectTopLevelCommentsForUri } from 'redux/selectors/comments';
|
||||
import { makeSelectTopLevelCommentsForUri } from 'redux/selectors/comments';
|
||||
import ChannelMentionSuggestions from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const subscriptionUris = selectSubscriptions(state).map(({ uri }) => uri);
|
||||
const topLevelComments = selectTopLevelCommentsForUri(state, props.uri);
|
||||
const topLevelComments = makeSelectTopLevelCommentsForUri(props.uri)(state);
|
||||
|
||||
const commentorUris = [];
|
||||
// Avoid repeated commentors
|
||||
|
||||
@@ -277,7 +277,7 @@ function ClaimListHeader(props: Props) {
|
||||
</div>
|
||||
{expanded && (
|
||||
<>
|
||||
<div className={classnames(`claim-search__menus`)}>
|
||||
<div className={classnames(`card claim-search__menus`)}>
|
||||
{/* FRESHNESS FIELD */}
|
||||
{orderParam === CS.ORDER_BY_TOP && (
|
||||
<div className="claim-search__input-container">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
selectClaimForUri,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectIsUriResolving,
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectClaimIsPending,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
makeSelectReflectingClaimForUri,
|
||||
makeSelectClaimWasPurchased,
|
||||
makeSelectTitleForUri,
|
||||
selectDateForUri,
|
||||
makeSelectDateForUri,
|
||||
} from 'redux/selectors/claims';
|
||||
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
|
||||
import {
|
||||
@@ -30,14 +30,14 @@ import ClaimPreview from './view';
|
||||
import formatMediaDuration from 'util/formatMediaDuration';
|
||||
|
||||
const select = (state, props) => {
|
||||
const claim = props.uri && selectClaimForUri(state, props.uri);
|
||||
const claim = props.uri && makeSelectClaimForUri(props.uri)(state);
|
||||
const media = claim && claim.value && (claim.value.video || claim.value.audio);
|
||||
const mediaDuration = media && media.duration && formatMediaDuration(media.duration, { screenReader: true });
|
||||
|
||||
return {
|
||||
claim,
|
||||
mediaDuration,
|
||||
date: props.uri && selectDateForUri(state, props.uri),
|
||||
date: props.uri && makeSelectDateForUri(props.uri)(state),
|
||||
title: props.uri && makeSelectTitleForUri(props.uri)(state),
|
||||
pending: props.uri && makeSelectClaimIsPending(props.uri)(state),
|
||||
reflectingProgress: props.uri && makeSelectReflectingClaimForUri(props.uri)(state),
|
||||
@@ -45,6 +45,7 @@ const select = (state, props) => {
|
||||
claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state),
|
||||
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
|
||||
isResolvingRepost: props.uri && makeSelectIsUriResolving(props.repostUrl)(state),
|
||||
repostClaim: props.uri && makeSelectClaimForUri(props.uri)(state),
|
||||
nsfw: props.uri && makeSelectClaimIsNsfw(props.uri)(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
filteredOutpoints: selectFilteredOutpoints(state),
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
makeSelectTitleForUri,
|
||||
makeSelectChannelForClaimUri,
|
||||
makeSelectClaimIsNsfw,
|
||||
selectDateForUri,
|
||||
makeSelectDateForUri,
|
||||
} from 'redux/selectors/claims';
|
||||
import { doFileGet } from 'redux/actions/file';
|
||||
import { doResolveUri } from 'redux/actions/claims';
|
||||
@@ -24,7 +24,7 @@ const select = (state, props) => {
|
||||
return {
|
||||
claim,
|
||||
mediaDuration,
|
||||
date: props.uri && selectDateForUri(state, props.uri),
|
||||
date: props.uri && makeSelectDateForUri(props.uri)(state),
|
||||
channel: props.uri && makeSelectChannelForClaimUri(props.uri)(state),
|
||||
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
|
||||
thumbnail: props.uri && makeSelectThumbnailForUri(props.uri)(state),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectTagsForUri } from 'redux/selectors/claims';
|
||||
import { makeSelectTagsForUri } from 'redux/selectors/claims';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import ClaimTags from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
tags: selectTagsForUri(state, props.uri),
|
||||
tags: makeSelectTagsForUri(props.uri)(state),
|
||||
followedTags: selectFollowedTags(state),
|
||||
});
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ type Props = {
|
||||
collectionId: string,
|
||||
showInfo: boolean,
|
||||
setShowInfo: (boolean) => void,
|
||||
showEdit: boolean,
|
||||
setShowEdit: (boolean) => void,
|
||||
collectionHasEdits: boolean,
|
||||
isBuiltin: boolean,
|
||||
doToggleShuffleList: (string, boolean) => void,
|
||||
@@ -46,8 +44,6 @@ function CollectionActions(props: Props) {
|
||||
doToggleShuffleList,
|
||||
playNextUri,
|
||||
firstItem,
|
||||
showEdit,
|
||||
setShowEdit,
|
||||
} = props;
|
||||
const [doShuffle, setDoShuffle] = React.useState(false);
|
||||
const { push } = useHistory();
|
||||
@@ -162,17 +158,6 @@ function CollectionActions(props: Props) {
|
||||
/>
|
||||
);
|
||||
|
||||
const showEditButton = (
|
||||
<Button
|
||||
title={__('Edit')}
|
||||
className={classnames('button-toggle', {
|
||||
'button-toggle--active': showEdit,
|
||||
})}
|
||||
icon={ICONS.EDIT}
|
||||
onClick={() => setShowEdit(!showEdit)}
|
||||
/>
|
||||
);
|
||||
|
||||
if (isMobile) {
|
||||
return (
|
||||
<div className="media__actions">
|
||||
@@ -188,12 +173,7 @@ function CollectionActions(props: Props) {
|
||||
{lhsSection}
|
||||
{rhsSection}
|
||||
</div>
|
||||
{uri && (
|
||||
<div className="section">
|
||||
{infoButton}
|
||||
{showEditButton}
|
||||
</div>
|
||||
)}
|
||||
{uri && <>{infoButton}</>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { doSetPlayingUri } from 'redux/actions/content';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import {
|
||||
selectLinkedCommentAncestors,
|
||||
selectOthersReactsForComment,
|
||||
makeSelectOthersReactionsForComment,
|
||||
makeSelectTotalReplyPagesForParentId,
|
||||
} from 'redux/selectors/comments';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
@@ -29,7 +29,7 @@ const select = (state, props) => {
|
||||
thumbnail: props.authorUri && makeSelectThumbnailForUri(props.authorUri)(state),
|
||||
channelIsBlocked: props.authorUri && makeSelectChannelIsMuted(props.authorUri)(state),
|
||||
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
||||
othersReacts: selectOthersReactsForComment(state, reactionKey),
|
||||
othersReacts: makeSelectOthersReactionsForComment(reactionKey)(state),
|
||||
activeChannelClaim,
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
playingUri: selectPlayingUri(state),
|
||||
|
||||
@@ -3,7 +3,7 @@ import Comment from './view';
|
||||
import { makeSelectClaimIsMine, makeSelectClaimForUri } from 'redux/selectors/claims';
|
||||
import { doResolveUri } from 'redux/actions/claims';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { selectMyReactsForComment, selectOthersReactsForComment } from 'redux/selectors/comments';
|
||||
import { makeSelectMyReactionsForComment, makeSelectOthersReactionsForComment } from 'redux/selectors/comments';
|
||||
import { doCommentReact } from 'redux/actions/comments';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
|
||||
@@ -15,8 +15,8 @@ const select = (state, props) => {
|
||||
return {
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
myReacts: selectMyReactsForComment(state, reactionKey),
|
||||
othersReacts: selectOthersReactsForComment(state, reactionKey),
|
||||
myReacts: makeSelectMyReactionsForComment(reactionKey)(state),
|
||||
othersReacts: makeSelectOthersReactionsForComment(reactionKey)(state),
|
||||
activeChannelId,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doResolveUris } from 'redux/actions/claims';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimIsMine,
|
||||
@@ -7,17 +6,17 @@ import {
|
||||
selectMyChannelClaims,
|
||||
} from 'redux/selectors/claims';
|
||||
import {
|
||||
selectTopLevelCommentsForUri,
|
||||
makeSelectTopLevelCommentsForUri,
|
||||
makeSelectTopLevelTotalPagesForUri,
|
||||
selectIsFetchingComments,
|
||||
selectIsFetchingCommentsById,
|
||||
selectIsFetchingReacts,
|
||||
makeSelectTotalCommentsCountForUri,
|
||||
selectOthersReacts,
|
||||
selectMyReacts,
|
||||
selectOthersReactsById,
|
||||
selectMyReactionsByCommentId,
|
||||
makeSelectCommentIdsForUri,
|
||||
selectSettingsByChannelId,
|
||||
selectPinnedCommentsForUri,
|
||||
makeSelectPinnedCommentsForUri,
|
||||
} from 'redux/selectors/comments';
|
||||
import { doCommentReset, doCommentList, doCommentById, doCommentReactList } from 'redux/actions/comments';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
@@ -25,19 +24,11 @@ import CommentsList from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const activeChannelClaim = selectActiveChannelClaim(state);
|
||||
const topLevelComments = selectTopLevelCommentsForUri(state, props.uri);
|
||||
|
||||
const resolvedComments =
|
||||
topLevelComments && topLevelComments.length > 0
|
||||
? topLevelComments.filter(({ channel_url }) => makeSelectClaimForUri(channel_url)(state) !== undefined)
|
||||
: [];
|
||||
|
||||
return {
|
||||
topLevelComments,
|
||||
resolvedComments,
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
allCommentIds: makeSelectCommentIdsForUri(props.uri)(state),
|
||||
pinnedComments: selectPinnedCommentsForUri(state, props.uri),
|
||||
pinnedComments: makeSelectPinnedCommentsForUri(props.uri)(state),
|
||||
topLevelComments: makeSelectTopLevelCommentsForUri(props.uri)(state),
|
||||
topLevelTotalPages: makeSelectTopLevelTotalPagesForUri(props.uri)(state),
|
||||
totalComments: makeSelectTotalCommentsCountForUri(props.uri)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
@@ -47,8 +38,8 @@ const select = (state, props) => {
|
||||
isFetchingReacts: selectIsFetchingReacts(state),
|
||||
fetchingChannels: selectFetchingMyChannels(state),
|
||||
settingsByChannelId: selectSettingsByChannelId(state),
|
||||
myReactsByCommentId: selectMyReacts(state),
|
||||
othersReactsById: selectOthersReacts(state),
|
||||
myReactsByCommentId: selectMyReactionsByCommentId(state),
|
||||
othersReactsById: selectOthersReactsById(state),
|
||||
activeChannelId: activeChannelClaim && activeChannelClaim.claim_id,
|
||||
};
|
||||
};
|
||||
@@ -58,7 +49,6 @@ const perform = (dispatch) => ({
|
||||
fetchComment: (commentId) => dispatch(doCommentById(commentId)),
|
||||
fetchReacts: (commentIds) => dispatch(doCommentReactList(commentIds)),
|
||||
resetComments: (claimId) => dispatch(doCommentReset(claimId)),
|
||||
doResolveUris: (uris) => dispatch(doResolveUris(uris, true)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CommentsList);
|
||||
@@ -1,27 +1,15 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doResolveUris } from 'redux/actions/claims';
|
||||
import { makeSelectClaimIsMine, selectMyChannelClaims, makeSelectClaimForUri } from 'redux/selectors/claims';
|
||||
import { selectIsFetchingCommentsByParentId, selectRepliesForParentId } from 'redux/selectors/comments';
|
||||
import { makeSelectClaimIsMine, selectMyChannelClaims } from 'redux/selectors/claims';
|
||||
import { selectIsFetchingCommentsByParentId, makeSelectRepliesForParentId } from 'redux/selectors/comments';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import CommentsReplies from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const fetchedReplies = selectRepliesForParentId(state, props.parentId);
|
||||
const resolvedReplies =
|
||||
fetchedReplies && fetchedReplies.length > 0
|
||||
? fetchedReplies.filter(({ channel_url }) => makeSelectClaimForUri(channel_url)(state) !== undefined)
|
||||
: [];
|
||||
const select = (state, props) => ({
|
||||
fetchedReplies: makeSelectRepliesForParentId(props.parentId)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
isFetchingByParentId: selectIsFetchingCommentsByParentId(state),
|
||||
});
|
||||
|
||||
return {
|
||||
fetchedReplies,
|
||||
resolvedReplies,
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
userCanComment: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
isFetchingByParentId: selectIsFetchingCommentsByParentId(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = (dispatch) => ({ doResolveUris: (uris) => dispatch(doResolveUris(uris, true)) });
|
||||
|
||||
export default connect(select, perform)(CommentsReplies);
|
||||
export default connect(select)(CommentsReplies);
|
||||
@@ -1,11 +1,11 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectDateForUri } from 'redux/selectors/claims';
|
||||
import { makeSelectDateForUri } from 'redux/selectors/claims';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import DateTime from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
date: props.date || selectDateForUri(state, props.uri),
|
||||
date: props.date || makeSelectDateForUri(props.uri)(state),
|
||||
clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state),
|
||||
});
|
||||
export default connect(select)(DateTime);
|
||||
@@ -23,6 +23,7 @@ import SignInVerifyPage from 'page/signInVerify';
|
||||
import BuyPage from 'page/buy';
|
||||
import ReceivePage from 'page/receive';
|
||||
import SendPage from 'page/send';
|
||||
import SwapPage from 'page/swap';
|
||||
import WalletPage from 'page/wallet';
|
||||
|
||||
// Chunk: none
|
||||
@@ -299,6 +300,7 @@ function AppRouter(props: Props) {
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.BUY}`} component={BuyPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.RECEIVE}`} component={ReceivePage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.SEND}`} component={SendPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.SWAP}`} component={SwapPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.NOTIFICATIONS}`} component={NotificationsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.AUTH_WALLET_PASSWORD}`} component={SignInWalletPasswordPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.SETTINGS_OWN_COMMENTS}`} component={OwnComments} />
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
// @flow
|
||||
|
||||
/*
|
||||
This component is not used at this time.
|
||||
*/
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import { FormField, Form } from 'component/common/form';
|
||||
|
||||
@@ -28,7 +28,7 @@ export const FRESH_DEFAULT = 'default';
|
||||
export const FRESH_TYPES = [FRESH_DEFAULT, FRESH_DAY, FRESH_WEEK, FRESH_MONTH, FRESH_YEAR, FRESH_ALL];
|
||||
|
||||
export const ORDER_BY_TRENDING = 'trending';
|
||||
export const ORDER_BY_TRENDING_VALUE = ['trending_score']; // was ['trending_group', 'trending_mixed'] - deprecated
|
||||
export const ORDER_BY_TRENDING_VALUE = ['trending_group', 'trending_mixed'];
|
||||
export const ORDER_BY_TOP = 'top';
|
||||
export const ORDER_BY_TOP_VALUE = ['effective_amount'];
|
||||
export const ORDER_BY_NEW = 'new';
|
||||
|
||||
+118
-87
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Page from 'component/page';
|
||||
import Card from 'component/common/card';
|
||||
@@ -13,6 +14,8 @@ import Button from 'component/button';
|
||||
import Nag from 'component/common/nag';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import classnames from 'classnames';
|
||||
import WalletSwap from 'component/walletSwap';
|
||||
|
||||
const MOONPAY_KEY = process.env.MOONPAY_SECRET_KEY;
|
||||
const COUNTRIES = Array.from(
|
||||
@@ -34,6 +37,11 @@ const COUNTRIES = Array.from(
|
||||
)
|
||||
);
|
||||
|
||||
const TAB = {
|
||||
BUY: 'BUY',
|
||||
SWAP: 'SWAP',
|
||||
};
|
||||
|
||||
type Props = {
|
||||
receiveAddress: ?string,
|
||||
gettingNewAddress: boolean,
|
||||
@@ -46,6 +54,7 @@ type Props = {
|
||||
export default function BuyPage(props: Props) {
|
||||
const { receiveAddress, gettingNewAddress, doGetNewAddress, email, user, doUserSetCountry } = props;
|
||||
const initialCountry = (user && user.country) || '';
|
||||
const [tab, setTab] = React.useState(TAB.BUY);
|
||||
const [url, setUrl] = React.useState();
|
||||
const [country, setCountry] = React.useState(initialCountry);
|
||||
const [showPurchaseScreen, setShowPurchaseScreen] = React.useState(false);
|
||||
@@ -98,99 +107,121 @@ export default function BuyPage(props: Props) {
|
||||
className="main--swap"
|
||||
backout={{
|
||||
backoutLabel: __('Done'),
|
||||
title: <LbcSymbol prefix={__('Buy')} size={28} />,
|
||||
title: <LbcSymbol prefix={__('Buy or Swap')} size={28} />,
|
||||
}}
|
||||
>
|
||||
<div className="section">
|
||||
<>
|
||||
{!user && (
|
||||
<div className="main--empty">
|
||||
<Spinner delayed />
|
||||
</div>
|
||||
)}
|
||||
<Button
|
||||
key="tip"
|
||||
icon={ICONS.BUY}
|
||||
label={__('Buy')}
|
||||
button="alt"
|
||||
onClick={() => setTab(TAB.BUY)}
|
||||
className={classnames('button-toggle', { 'button-toggle--active': tab === TAB.BUY })}
|
||||
/>
|
||||
<Button
|
||||
key="boost"
|
||||
icon={ICONS.COIN_SWAP}
|
||||
label={__('Swap')}
|
||||
button="alt"
|
||||
onClick={() => setTab(TAB.SWAP)}
|
||||
className={classnames('button-toggle', { 'button-toggle--active': tab === TAB.SWAP })}
|
||||
/>
|
||||
</div>
|
||||
<div className="section">
|
||||
{tab === TAB.SWAP && <WalletSwap />}
|
||||
{tab === TAB.BUY && (
|
||||
<>
|
||||
{!user && (
|
||||
<div className="main--empty">
|
||||
<Spinner delayed />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{user && (
|
||||
<>
|
||||
{showPurchaseScreen ? (
|
||||
<Card
|
||||
title={title}
|
||||
subtitle={subtitle}
|
||||
actions={
|
||||
url ? (
|
||||
<iframe
|
||||
allow="accelerometer; autoplay; camera; gyroscope; payment"
|
||||
frameBorder="0"
|
||||
src={url}
|
||||
width="100%"
|
||||
>
|
||||
<p>{__('Your browser does not support iframes.')}</p>
|
||||
</iframe>
|
||||
) : (
|
||||
<div className="main--empty">
|
||||
<Spinner delayed />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Card
|
||||
title={title}
|
||||
subtitle={subtitle}
|
||||
nag={
|
||||
country && !isValid && <Nag relative type="helpful" message={"This country isn't supported yet."} />
|
||||
}
|
||||
actions={
|
||||
<div>
|
||||
<div className="section">
|
||||
<FormField
|
||||
label={__('Country')}
|
||||
type="select"
|
||||
name="country-codes"
|
||||
helper={__(
|
||||
'Only some countries are eligible at this time. We are working to make this available to everyone.'
|
||||
)}
|
||||
value={country}
|
||||
onChange={(e) => setCountry(e.target.value)}
|
||||
{user && (
|
||||
<>
|
||||
{showPurchaseScreen ? (
|
||||
<Card
|
||||
title={title}
|
||||
subtitle={subtitle}
|
||||
actions={
|
||||
url ? (
|
||||
<iframe
|
||||
allow="accelerometer; autoplay; camera; gyroscope; payment"
|
||||
frameBorder="0"
|
||||
src={url}
|
||||
width="100%"
|
||||
>
|
||||
<option value="" disabled defaultValue>
|
||||
{__('Select your country')}
|
||||
</option>
|
||||
{COUNTRIES.map((country, index) => (
|
||||
<option key={country} value={country}>
|
||||
{country}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
{country && (
|
||||
<div className="section">
|
||||
{isValid ? (
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
label={__('Continue')}
|
||||
onClick={() => setShowPurchaseScreen(true)}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="section__actions">
|
||||
<Button button="alt" label={__('Go Back')} onClick={() => goBack()} />
|
||||
<Button
|
||||
button="link"
|
||||
label={__('Try Anyway')}
|
||||
onClick={() => setShowPurchaseScreen(true)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<p>{__('Your browser does not support iframes.')}</p>
|
||||
</iframe>
|
||||
) : (
|
||||
<div className="main--empty">
|
||||
<Spinner delayed />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Card
|
||||
title={title}
|
||||
subtitle={subtitle}
|
||||
nag={
|
||||
country &&
|
||||
!isValid && <Nag relative type="helpful" message={"This country isn't supported yet."} />
|
||||
}
|
||||
actions={
|
||||
<div>
|
||||
<div className="section">
|
||||
<FormField
|
||||
label={__('Country')}
|
||||
type="select"
|
||||
name="country-codes"
|
||||
helper={__(
|
||||
'Only some countries are eligible at this time. We are working to make this available to everyone.'
|
||||
)}
|
||||
value={country}
|
||||
onChange={(e) => setCountry(e.target.value)}
|
||||
>
|
||||
<option value="" disabled defaultValue>
|
||||
{__('Select your country')}
|
||||
</option>
|
||||
{COUNTRIES.map((country, index) => (
|
||||
<option key={country} value={country}>
|
||||
{country}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
{country && (
|
||||
<div className="section">
|
||||
{isValid ? (
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
label={__('Continue')}
|
||||
onClick={() => setShowPurchaseScreen(true)}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="section__actions">
|
||||
<Button button="alt" label={__('Go Back')} onClick={() => goBack()} />
|
||||
<Button
|
||||
button="link"
|
||||
label={__('Try Anyway')}
|
||||
onClick={() => setShowPurchaseScreen(true)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
|
||||
@@ -49,7 +49,7 @@ function ChannelsFollowingDiscover(props: Props) {
|
||||
options: {
|
||||
pageSize: 12,
|
||||
claimType: 'channel',
|
||||
orderBy: CS.ORDER_BY_TOP_VALUE,
|
||||
orderBy: ['effective_amount'],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ function ChannelsFollowingDiscover(props: Props) {
|
||||
options: {
|
||||
pageSize: 8,
|
||||
claimType: 'channel',
|
||||
orderBy: CS.ORDER_BY_TRENDING_VALUE,
|
||||
orderBy: ['trending_group', 'trending_mixed'],
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ export default function CollectionPage(props: Props) {
|
||||
|
||||
const [didTryResolve, setDidTryResolve] = React.useState(false);
|
||||
const [showInfo, setShowInfo] = React.useState(false);
|
||||
const [showEdit, setShowEdit] = React.useState(false);
|
||||
const { name, totalItems } = collection || {};
|
||||
const isBuiltin = COLLECTIONS_CONSTS.BUILTIN_LISTS.includes(collectionId);
|
||||
|
||||
@@ -134,8 +133,6 @@ export default function CollectionPage(props: Props) {
|
||||
showInfo={showInfo}
|
||||
isBuiltin={isBuiltin}
|
||||
collectionUrls={collectionUrls}
|
||||
setShowEdit={setShowEdit}
|
||||
showEdit={showEdit}
|
||||
/>
|
||||
}
|
||||
actions={
|
||||
@@ -191,7 +188,7 @@ export default function CollectionPage(props: Props) {
|
||||
<Page>
|
||||
<div className={classnames('section card-stack')}>
|
||||
{info}
|
||||
<ClaimList uris={collectionUrls} collectionId={collectionId} type={showEdit ? 'listview' : undefined} />
|
||||
<ClaimList uris={collectionUrls} collectionId={collectionId} type={'listview'} />
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { doCommentListOwn, doCommentReset } from 'redux/actions/comments';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
import {
|
||||
selectIsFetchingComments,
|
||||
selectCommentsForUri,
|
||||
makeSelectCommentsForUri,
|
||||
makeSelectTotalCommentsCountForUri,
|
||||
makeSelectTopLevelTotalPagesForUri,
|
||||
} from 'redux/selectors/comments';
|
||||
@@ -17,7 +17,7 @@ const select = (state) => {
|
||||
|
||||
return {
|
||||
activeChannelClaim,
|
||||
allComments: selectCommentsForUri(state, uri),
|
||||
allComments: makeSelectCommentsForUri(uri)(state),
|
||||
totalComments: makeSelectTotalCommentsCountForUri(uri)(state),
|
||||
topLevelTotalPages: makeSelectTopLevelTotalPagesForUri(uri)(state),
|
||||
isFetchingComments: selectIsFetchingComments(state),
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import SwapPage from './view';
|
||||
|
||||
const select = (state) => ({});
|
||||
|
||||
export default connect(select, null)(SwapPage);
|
||||
@@ -0,0 +1,21 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Page from 'component/page';
|
||||
import WalletSwap from 'component/walletSwap';
|
||||
|
||||
type Props = {};
|
||||
|
||||
export default function SwapPage(props: Props) {
|
||||
return (
|
||||
<Page
|
||||
noSideNavigation
|
||||
className="main--swap"
|
||||
backout={{
|
||||
backoutLabel: __('Done'),
|
||||
title: __('Swap Crypto'),
|
||||
}}
|
||||
>
|
||||
<WalletSwap />
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -9,8 +9,8 @@ import { selectClaimsByUri, selectMyChannelClaims } from 'redux/selectors/claims
|
||||
import { doClaimSearch } from 'redux/actions/claims';
|
||||
import { doToast, doSeeNotifications } from 'redux/actions/notifications';
|
||||
import {
|
||||
selectMyReactsForComment,
|
||||
selectOthersReactsForComment,
|
||||
makeSelectMyReactionsForComment,
|
||||
makeSelectOthersReactionsForComment,
|
||||
selectPendingCommentReacts,
|
||||
selectModerationBlockList,
|
||||
selectModerationDelegatorsById,
|
||||
@@ -466,8 +466,8 @@ export function doCommentReact(commentId: string, type: string) {
|
||||
}
|
||||
|
||||
const reactKey = `${commentId}:${activeChannelClaim.claim_id}`;
|
||||
const myReacts = selectMyReactsForComment(state, reactKey) || [];
|
||||
const othersReacts = selectOthersReactsForComment(state, reactKey) || {};
|
||||
const myReacts = makeSelectMyReactionsForComment(reactKey)(state);
|
||||
const othersReacts = makeSelectOthersReactionsForComment(reactKey)(state);
|
||||
|
||||
const signatureData = await channelSignName(activeChannelClaim.claim_id, activeChannelClaim.name);
|
||||
if (!signatureData) {
|
||||
|
||||
@@ -65,22 +65,11 @@ export default handleActions(
|
||||
[ACTIONS.USER_STATE_POPULATE]: (state: TagState, action: { data: { tags: ?Array<string> } }) => {
|
||||
const { tags } = action.data;
|
||||
if (Array.isArray(tags)) {
|
||||
const next = tags && tags.filter((tag) => typeof tag === 'string');
|
||||
const prev = state.followedTags;
|
||||
|
||||
if (next && prev && prev.length === next.length && prev.every((value, index) => value === next[index])) {
|
||||
// No changes
|
||||
return state;
|
||||
}
|
||||
|
||||
// New state
|
||||
return {
|
||||
...state,
|
||||
followedTags: next || [],
|
||||
followedTags: tags,
|
||||
};
|
||||
}
|
||||
|
||||
// Purge 'followedTags'
|
||||
return {
|
||||
...state,
|
||||
};
|
||||
|
||||
@@ -2,22 +2,20 @@
|
||||
import { normalizeURI, parseURI, isURIValid } from 'util/lbryURI';
|
||||
import { selectSupportsByOutpoint } from 'redux/selectors/wallet';
|
||||
import { createSelector } from 'reselect';
|
||||
import { createCachedSelector } from 're-reselect';
|
||||
import { isClaimNsfw, filterClaims } from 'util/claim';
|
||||
import * as CLAIM from 'constants/claim';
|
||||
|
||||
type State = { claims: any };
|
||||
|
||||
const selectState = (state) => state.claims || {};
|
||||
|
||||
export const selectById = (state: State) => selectState(state).byId || {};
|
||||
export const selectPendingClaimsById = (state: State) => selectState(state).pendingById || {};
|
||||
export const selectById = createSelector(selectState, (state) => state.byId || {});
|
||||
|
||||
export const selectPendingClaimsById = createSelector(selectState, (state) => state.pendingById || {});
|
||||
|
||||
export const selectClaimsById = createSelector(selectById, selectPendingClaimsById, (byId, pendingById) => {
|
||||
return Object.assign(byId, pendingById); // do I need merged to keep metadata?
|
||||
});
|
||||
|
||||
export const selectClaimIdsByUri = (state: State) => selectState(state).claimsByUri || {};
|
||||
export const selectClaimIdsByUri = createSelector(selectState, (state) => state.claimsByUri || {});
|
||||
|
||||
export const selectCurrentChannelPage = createSelector(selectState, (state) => state.currentChannelPage || 1);
|
||||
|
||||
@@ -76,43 +74,6 @@ export const selectReflectingById = createSelector(selectState, (state) => state
|
||||
|
||||
export const makeSelectClaimForClaimId = (claimId: string) => createSelector(selectClaimsById, (byId) => byId[claimId]);
|
||||
|
||||
export const selectClaimForUri = createCachedSelector(
|
||||
selectClaimIdsByUri,
|
||||
selectClaimsById,
|
||||
(state, uri) => uri,
|
||||
(state, uri, returnRepost = true) => returnRepost,
|
||||
(byUri, byId, uri, returnRepost) => {
|
||||
const validUri = isURIValid(uri);
|
||||
|
||||
if (validUri && byUri) {
|
||||
const claimId = uri && byUri[normalizeURI(uri)];
|
||||
const claim = byId[claimId];
|
||||
|
||||
// Make sure to return the claim as is so apps can check if it's been resolved before (null) or still needs to be resolved (undefined)
|
||||
if (claimId === null) {
|
||||
return null;
|
||||
} else if (claimId === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const repostedClaim = claim && claim.reposted_claim;
|
||||
if (repostedClaim && returnRepost) {
|
||||
const channelUrl =
|
||||
claim.signing_channel && (claim.signing_channel.canonical_url || claim.signing_channel.permanent_url);
|
||||
|
||||
return {
|
||||
...repostedClaim,
|
||||
repost_url: normalizeURI(uri),
|
||||
repost_channel_url: channelUrl,
|
||||
repost_bid_amount: claim && claim.meta && claim.meta.effective_amount,
|
||||
};
|
||||
} else {
|
||||
return claim;
|
||||
}
|
||||
}
|
||||
}
|
||||
)((state, uri, returnRepost = true) => `${uri}:${returnRepost ? '1' : '0'}`);
|
||||
|
||||
export const makeSelectClaimForUri = (uri: string, returnRepost: boolean = true) =>
|
||||
createSelector(selectClaimIdsByUri, selectClaimsById, (byUri, byId) => {
|
||||
const validUri = isURIValid(uri);
|
||||
@@ -267,11 +228,6 @@ export const makeSelectTotalPagesInChannelSearch = (uri: string) =>
|
||||
return byChannel['pageCount'];
|
||||
});
|
||||
|
||||
export const selectMetadataForUri = createCachedSelector(selectClaimForUri, (claim, uri) => {
|
||||
const metadata = claim && claim.value;
|
||||
return metadata || (claim === undefined ? undefined : null);
|
||||
})((state, uri) => uri);
|
||||
|
||||
export const makeSelectMetadataForUri = (uri: string) =>
|
||||
createSelector(makeSelectClaimForUri(uri), (claim) => {
|
||||
const metadata = claim && claim.value;
|
||||
@@ -286,9 +242,8 @@ export const makeSelectMetadataItemForUri = (uri: string, key: string) =>
|
||||
export const makeSelectTitleForUri = (uri: string) =>
|
||||
createSelector(makeSelectMetadataForUri(uri), (metadata) => metadata && metadata.title);
|
||||
|
||||
export const selectDateForUri = createCachedSelector(
|
||||
selectClaimForUri, // input: (state, uri, ?returnRepost)
|
||||
(claim) => {
|
||||
export const makeSelectDateForUri = (uri: string) =>
|
||||
createSelector(makeSelectClaimForUri(uri), (claim) => {
|
||||
const timestamp =
|
||||
claim &&
|
||||
claim.value &&
|
||||
@@ -302,8 +257,7 @@ export const selectDateForUri = createCachedSelector(
|
||||
}
|
||||
const dateObj = new Date(timestamp);
|
||||
return dateObj;
|
||||
}
|
||||
)((state, uri) => uri);
|
||||
});
|
||||
|
||||
export const makeSelectAmountForUri = (uri: string) =>
|
||||
createSelector(makeSelectClaimForUri(uri), (claim) => {
|
||||
@@ -539,10 +493,6 @@ export const makeSelectMyChannelPermUrlForName = (name: string) =>
|
||||
return matchingClaim ? matchingClaim.permanent_url : null;
|
||||
});
|
||||
|
||||
export const selectTagsForUri = createCachedSelector(selectMetadataForUri, (metadata: ?GenericMetadata) => {
|
||||
return (metadata && metadata.tags) || [];
|
||||
})((state, uri) => uri);
|
||||
|
||||
export const makeSelectTagsForUri = (uri: string) =>
|
||||
createSelector(makeSelectMetadataForUri(uri), (metadata: ?GenericMetadata) => {
|
||||
return (metadata && metadata.tags) || [];
|
||||
|
||||
+221
-206
@@ -1,79 +1,43 @@
|
||||
// @flow
|
||||
import { createSelector } from 'reselect';
|
||||
import { createCachedSelector } from 're-reselect';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { selectBlacklistedOutpointMap, selectFilteredOutpointMap } from 'lbryinc';
|
||||
import { selectClaimsById, selectMyActiveClaims } from 'redux/selectors/claims';
|
||||
import { isClaimNsfw } from 'util/claim';
|
||||
|
||||
type State = { comments: CommentsState };
|
||||
|
||||
const selectState = (state) => state.comments || {};
|
||||
|
||||
export const selectCommentsById = (state: State) => selectState(state).commentById || {};
|
||||
export const selectIsFetchingComments = (state: State) => selectState(state).isLoading;
|
||||
export const selectIsFetchingCommentsById = (state: State) => selectState(state).isLoadingById;
|
||||
export const selectIsFetchingCommentsByParentId = (state: State) => selectState(state).isLoadingByParentId;
|
||||
export const selectIsFetchingReacts = (state: State) => selectState(state).isFetchingReacts;
|
||||
export const selectCommentsById = createSelector(selectState, (state) => state.commentById || {});
|
||||
export const selectIsFetchingComments = createSelector(selectState, (state) => state.isLoading);
|
||||
export const selectIsFetchingCommentsById = createSelector(selectState, (state) => state.isLoadingById);
|
||||
export const selectIsFetchingCommentsByParentId = createSelector(selectState, (state) => state.isLoadingByParentId);
|
||||
export const selectIsFetchingReacts = createSelector(selectState, (state) => state.isFetchingReacts);
|
||||
export const selectOthersReactsById = createSelector(selectState, (state) => state.othersReactsByCommentId);
|
||||
|
||||
export const selectMyReacts = (state: State) => state.comments.myReactsByCommentId;
|
||||
export const selectMyReactsForComment = (state: State, commentIdChannelId: string) => {
|
||||
// @commentIdChannelId: Format = 'commentId:MyChannelId'
|
||||
return state.comments.myReactsByCommentId && state.comments.myReactsByCommentId[commentIdChannelId];
|
||||
};
|
||||
export const selectPinnedCommentsById = createSelector(selectState, (state) => state.pinnedCommentsById);
|
||||
export const makeSelectPinnedCommentsForUri = (uri: string) =>
|
||||
createSelector(
|
||||
selectCommentsByUri,
|
||||
selectCommentsById,
|
||||
selectPinnedCommentsById,
|
||||
(byUri, byId, pinnedCommentsById) => {
|
||||
const claimId = byUri[uri];
|
||||
const pinnedCommentIds = pinnedCommentsById && pinnedCommentsById[claimId];
|
||||
const pinnedComments = [];
|
||||
|
||||
export const selectOthersReacts = (state: State) => state.comments.othersReactsByCommentId;
|
||||
export const selectOthersReactsForComment = (state: State, id: string) => {
|
||||
return state.comments.othersReactsByCommentId && state.comments.othersReactsByCommentId[id];
|
||||
};
|
||||
if (pinnedCommentIds) {
|
||||
pinnedCommentIds.forEach((commentId) => {
|
||||
pinnedComments.push(byId[commentId]);
|
||||
});
|
||||
}
|
||||
|
||||
// previously this used a mapping from claimId -> Array<Comments>
|
||||
/* export const selectCommentsById = createSelector(
|
||||
selectState,
|
||||
state => state.byId || {}
|
||||
); */
|
||||
export const selectCommentsByUri = createSelector(selectState, (state) => {
|
||||
const byUri = state.commentsByUri || {};
|
||||
const comments = {};
|
||||
Object.keys(byUri).forEach((uri) => {
|
||||
const claimId = byUri[uri];
|
||||
if (claimId === null) {
|
||||
comments[uri] = null;
|
||||
} else {
|
||||
comments[uri] = claimId;
|
||||
return pinnedComments;
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
return comments;
|
||||
});
|
||||
|
||||
export const selectPinnedCommentsById = (state: State) => selectState(state).pinnedCommentsById;
|
||||
export const selectPinnedCommentsForUri = createCachedSelector(
|
||||
selectCommentsByUri,
|
||||
selectCommentsById,
|
||||
selectPinnedCommentsById,
|
||||
(state, uri) => uri,
|
||||
(byUri, byId, pinnedCommentsById, uri) => {
|
||||
const claimId = byUri[uri];
|
||||
const pinnedCommentIds = pinnedCommentsById && pinnedCommentsById[claimId];
|
||||
const pinnedComments = [];
|
||||
|
||||
if (pinnedCommentIds) {
|
||||
pinnedCommentIds.forEach((commentId) => {
|
||||
pinnedComments.push(byId[commentId]);
|
||||
});
|
||||
}
|
||||
|
||||
return pinnedComments;
|
||||
}
|
||||
)((state, uri) => uri);
|
||||
|
||||
export const selectModerationBlockList = createSelector(
|
||||
(state) => selectState(state).moderationBlockList,
|
||||
(moderationBlockList) => {
|
||||
return moderationBlockList ? moderationBlockList.reverse() : [];
|
||||
}
|
||||
export const selectModerationBlockList = createSelector(selectState, (state) =>
|
||||
state.moderationBlockList ? state.moderationBlockList.reverse() : []
|
||||
);
|
||||
export const selectAdminBlockList = createSelector(selectState, (state) =>
|
||||
state.adminBlockList ? state.adminBlockList.reverse() : []
|
||||
@@ -82,19 +46,35 @@ export const selectModeratorBlockList = createSelector(selectState, (state) =>
|
||||
state.moderatorBlockList ? state.moderatorBlockList.reverse() : []
|
||||
);
|
||||
|
||||
export const selectPersonalTimeoutMap = (state: State) => selectState(state).personalTimeoutMap;
|
||||
export const selectAdminTimeoutMap = (state: State) => selectState(state).adminTimeoutMap;
|
||||
export const selectModeratorTimeoutMap = (state: State) => selectState(state).moderatorTimeoutMap;
|
||||
export const selectModeratorBlockListDelegatorsMap = (state: State) =>
|
||||
selectState(state).moderatorBlockListDelegatorsMap;
|
||||
export const selectTogglingForDelegatorMap = (state: State) => selectState(state).togglingForDelegatorMap;
|
||||
export const selectBlockingByUri = (state: State) => selectState(state).blockingByUri;
|
||||
export const selectUnBlockingByUri = (state: State) => selectState(state).unBlockingByUri;
|
||||
export const selectFetchingModerationBlockList = (state: State) => selectState(state).fetchingModerationBlockList;
|
||||
export const selectModerationDelegatesById = (state: State) => selectState(state).moderationDelegatesById;
|
||||
export const selectIsFetchingModerationDelegates = (state: State) => selectState(state).fetchingModerationDelegates;
|
||||
export const selectModerationDelegatorsById = (state: State) => selectState(state).moderationDelegatorsById;
|
||||
export const selectIsFetchingModerationDelegators = (state: State) => selectState(state).fetchingModerationDelegators;
|
||||
export const selectPersonalTimeoutMap = createSelector(selectState, (state) => state.personalTimeoutMap);
|
||||
export const selectAdminTimeoutMap = createSelector(selectState, (state) => state.adminTimeoutMap);
|
||||
export const selectModeratorTimeoutMap = createSelector(selectState, (state) => state.moderatorTimeoutMap);
|
||||
|
||||
export const selectModeratorBlockListDelegatorsMap = createSelector(
|
||||
selectState,
|
||||
(state) => state.moderatorBlockListDelegatorsMap
|
||||
);
|
||||
|
||||
export const selectTogglingForDelegatorMap = createSelector(selectState, (state) => state.togglingForDelegatorMap);
|
||||
|
||||
export const selectBlockingByUri = createSelector(selectState, (state) => state.blockingByUri);
|
||||
export const selectUnBlockingByUri = createSelector(selectState, (state) => state.unBlockingByUri);
|
||||
export const selectFetchingModerationBlockList = createSelector(
|
||||
selectState,
|
||||
(state) => state.fetchingModerationBlockList
|
||||
);
|
||||
|
||||
export const selectModerationDelegatesById = createSelector(selectState, (state) => state.moderationDelegatesById);
|
||||
export const selectIsFetchingModerationDelegates = createSelector(
|
||||
selectState,
|
||||
(state) => state.fetchingModerationDelegates
|
||||
);
|
||||
|
||||
export const selectModerationDelegatorsById = createSelector(selectState, (state) => state.moderationDelegatorsById);
|
||||
export const selectIsFetchingModerationDelegators = createSelector(
|
||||
selectState,
|
||||
(state) => state.fetchingModerationDelegators
|
||||
);
|
||||
|
||||
export const selectHasAdminChannel = createSelector(selectState, (state) => {
|
||||
const myChannelIds = Object.keys(state.moderationDelegatorsById);
|
||||
@@ -127,29 +107,24 @@ export const selectCommentsByClaimId = createSelector(selectState, selectComment
|
||||
return comments;
|
||||
});
|
||||
|
||||
// no superchats?
|
||||
export const selectSuperchatsByUri = (state: State) => selectState(state).superChatsByUri;
|
||||
export const selectSuperchatsByUri = createSelector(selectState, (state) => state.superChatsByUri);
|
||||
|
||||
export const selectTopLevelCommentsByClaimId = createSelector(
|
||||
(state) => selectState(state).topLevelCommentsById,
|
||||
selectCommentsById,
|
||||
(topLevelCommentsById, byId) => {
|
||||
const byClaimId = topLevelCommentsById || {};
|
||||
const comments = {};
|
||||
export const selectTopLevelCommentsByClaimId = createSelector(selectState, selectCommentsById, (state, byId) => {
|
||||
const byClaimId = state.topLevelCommentsById || {};
|
||||
const comments = {};
|
||||
|
||||
// replace every comment_id in the list with the actual comment object
|
||||
Object.keys(byClaimId).forEach((claimId) => {
|
||||
const commentIds = byClaimId[claimId];
|
||||
// replace every comment_id in the list with the actual comment object
|
||||
Object.keys(byClaimId).forEach((claimId) => {
|
||||
const commentIds = byClaimId[claimId];
|
||||
|
||||
comments[claimId] = Array(commentIds === null ? 0 : commentIds.length);
|
||||
for (let i = 0; i < commentIds.length; i++) {
|
||||
comments[claimId][i] = byId[commentIds[i]];
|
||||
}
|
||||
});
|
||||
comments[claimId] = Array(commentIds === null ? 0 : commentIds.length);
|
||||
for (let i = 0; i < commentIds.length; i++) {
|
||||
comments[claimId][i] = byId[commentIds[i]];
|
||||
}
|
||||
});
|
||||
|
||||
return comments;
|
||||
}
|
||||
);
|
||||
return comments;
|
||||
});
|
||||
|
||||
export const makeSelectCommentForCommentId = (commentId: string) =>
|
||||
createSelector(selectCommentsById, (comments) => comments[commentId]);
|
||||
@@ -171,7 +146,27 @@ export const selectRepliesByParentId = createSelector(selectState, selectComment
|
||||
return comments;
|
||||
});
|
||||
|
||||
export const selectLinkedCommentAncestors = (state: State) => selectState(state).linkedCommentAncestors;
|
||||
// previously this used a mapping from claimId -> Array<Comments>
|
||||
/* export const selectCommentsById = createSelector(
|
||||
selectState,
|
||||
state => state.byId || {}
|
||||
); */
|
||||
export const selectCommentsByUri = createSelector(selectState, (state) => {
|
||||
const byUri = state.commentsByUri || {};
|
||||
const comments = {};
|
||||
Object.keys(byUri).forEach((uri) => {
|
||||
const claimId = byUri[uri];
|
||||
if (claimId === null) {
|
||||
comments[uri] = null;
|
||||
} else {
|
||||
comments[uri] = claimId;
|
||||
}
|
||||
});
|
||||
|
||||
return comments;
|
||||
});
|
||||
|
||||
export const selectLinkedCommentAncestors = createSelector(selectState, (state) => state.linkedCommentAncestors);
|
||||
|
||||
export const makeSelectCommentIdsForUri = (uri: string) =>
|
||||
createSelector(selectState, selectCommentsByUri, selectClaimsById, (state, byUri) => {
|
||||
@@ -179,48 +174,62 @@ export const makeSelectCommentIdsForUri = (uri: string) =>
|
||||
return state.byId[claimId];
|
||||
});
|
||||
|
||||
const filterCommentsDepOnList = {
|
||||
claimsById: selectClaimsById,
|
||||
myClaims: selectMyActiveClaims,
|
||||
mutedChannels: selectMutedChannels,
|
||||
personalBlockList: selectModerationBlockList,
|
||||
blacklistedMap: selectBlacklistedOutpointMap,
|
||||
filteredMap: selectFilteredOutpointMap,
|
||||
showMatureContent: selectShowMatureContent,
|
||||
};
|
||||
export const selectMyReactionsByCommentId = createSelector(selectState, (state) => state.myReactsByCommentId);
|
||||
|
||||
const filterCommentsPropKeys = Object.keys(filterCommentsDepOnList);
|
||||
/**
|
||||
* makeSelectMyReactionsForComment
|
||||
*
|
||||
* @param commentIdChannelId Format = "commentId:MyChannelId".
|
||||
*/
|
||||
export const makeSelectMyReactionsForComment = (commentIdChannelId: string) =>
|
||||
createSelector(selectState, (state) => {
|
||||
if (!state.myReactsByCommentId) {
|
||||
return [];
|
||||
}
|
||||
|
||||
export const selectPendingCommentReacts = (state: State) => selectState(state).pendingCommentReactions;
|
||||
export const selectSettingsByChannelId = (state: State) => selectState(state).settingsByChannelId;
|
||||
export const selectFetchingCreatorSettings = (state: State) => selectState(state).fetchingSettings;
|
||||
export const selectFetchingBlockedWords = (state: State) => selectState(state).fetchingBlockedWords;
|
||||
return state.myReactsByCommentId[commentIdChannelId] || [];
|
||||
});
|
||||
|
||||
export const selectCommentsForUri = createCachedSelector(
|
||||
(state, uri) => uri,
|
||||
selectCommentsByClaimId,
|
||||
selectCommentsByUri,
|
||||
...Object.values(filterCommentsDepOnList),
|
||||
(uri, byClaimId, byUri, ...filterInputs) => {
|
||||
const claimId = byUri[uri];
|
||||
const comments = byClaimId && byClaimId[claimId];
|
||||
return filterComments(comments, claimId, filterInputs);
|
||||
}
|
||||
)((state, uri) => uri);
|
||||
export const makeSelectOthersReactionsForComment = (commentId: string) =>
|
||||
createSelector(selectState, (state) => {
|
||||
if (!state.othersReactsByCommentId) {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const selectTopLevelCommentsForUri = createCachedSelector(
|
||||
(state, uri) => uri,
|
||||
(state, uri, maxCount) => maxCount,
|
||||
selectTopLevelCommentsByClaimId,
|
||||
selectCommentsByUri,
|
||||
...Object.values(filterCommentsDepOnList),
|
||||
(uri, maxCount = -1, byClaimId, byUri, ...filterInputs) => {
|
||||
const claimId = byUri[uri];
|
||||
const comments = byClaimId && byClaimId[claimId];
|
||||
const filtered = filterComments(comments, claimId, filterInputs);
|
||||
return maxCount > 0 ? filtered.slice(0, maxCount) : filtered;
|
||||
}
|
||||
)((state, uri, maxCount = -1) => `${uri}:${maxCount}`);
|
||||
return state.othersReactsByCommentId[commentId] || {};
|
||||
});
|
||||
|
||||
export const selectPendingCommentReacts = createSelector(selectState, (state) => state.pendingCommentReactions);
|
||||
|
||||
export const selectSettingsByChannelId = createSelector(selectState, (state) => state.settingsByChannelId);
|
||||
|
||||
export const selectFetchingCreatorSettings = createSelector(selectState, (state) => state.fetchingSettings);
|
||||
|
||||
export const selectFetchingBlockedWords = createSelector(selectState, (state) => state.fetchingBlockedWords);
|
||||
|
||||
export const makeSelectCommentsForUri = (uri: string) =>
|
||||
createSelector(
|
||||
(state) => state,
|
||||
selectCommentsByClaimId,
|
||||
selectCommentsByUri,
|
||||
(state, byClaimId, byUri) => {
|
||||
const claimId = byUri[uri];
|
||||
const comments = byClaimId && byClaimId[claimId];
|
||||
return makeSelectFilteredComments(comments, claimId)(state);
|
||||
}
|
||||
);
|
||||
|
||||
export const makeSelectTopLevelCommentsForUri = (uri: string) =>
|
||||
createSelector(
|
||||
(state) => state,
|
||||
selectTopLevelCommentsByClaimId,
|
||||
selectCommentsByUri,
|
||||
(state, byClaimId, byUri) => {
|
||||
const claimId = byUri[uri];
|
||||
const comments = byClaimId && byClaimId[claimId];
|
||||
return makeSelectFilteredComments(comments, claimId)(state);
|
||||
}
|
||||
);
|
||||
|
||||
export const makeSelectTopLevelTotalCommentsForUri = (uri: string) =>
|
||||
createSelector(selectState, selectCommentsByUri, (state, byUri) => {
|
||||
@@ -234,93 +243,99 @@ export const makeSelectTopLevelTotalPagesForUri = (uri: string) =>
|
||||
return state.topLevelTotalPagesById[claimId] || 0;
|
||||
});
|
||||
|
||||
export const selectRepliesForParentId = createCachedSelector(
|
||||
(state, id) => id,
|
||||
(state) => selectState(state).repliesByParentId,
|
||||
selectCommentsById,
|
||||
...Object.values(filterCommentsDepOnList),
|
||||
(id, repliesByParentId, commentsById, ...filterInputs) => {
|
||||
// const claimId = byUri[uri]; // just parentId (id)
|
||||
const replyIdsForParent = repliesByParentId[id] || [];
|
||||
if (!replyIdsForParent.length) return null;
|
||||
export const makeSelectRepliesForParentId = (id: string) =>
|
||||
createSelector(
|
||||
(state) => state,
|
||||
selectCommentsById,
|
||||
(state, commentsById) => {
|
||||
// const claimId = byUri[uri]; // just parentId (id)
|
||||
const replyIdsByParentId = state.comments.repliesByParentId;
|
||||
const replyIdsForParent = replyIdsByParentId[id] || [];
|
||||
if (!replyIdsForParent.length) return null;
|
||||
|
||||
const comments = [];
|
||||
replyIdsForParent.forEach((cid) => {
|
||||
comments.push(commentsById[cid]);
|
||||
});
|
||||
// const comments = byParentId && byParentId[id];
|
||||
const comments = [];
|
||||
replyIdsForParent.forEach((cid) => {
|
||||
comments.push(commentsById[cid]);
|
||||
});
|
||||
// const comments = byParentId && byParentId[id];
|
||||
|
||||
return filterComments(comments, undefined, filterInputs);
|
||||
}
|
||||
)((state, id: string) => id);
|
||||
return makeSelectFilteredComments(comments)(state);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* filterComments
|
||||
* makeSelectFilteredComments
|
||||
*
|
||||
* @param comments List of comments to filter.
|
||||
* @param claimId The claim that `comments` reside in.
|
||||
* @oaram filterInputs Values returned by filterCommentsDepOnList.
|
||||
*/
|
||||
const filterComments = (comments: Array<Comment>, claimId?: string, filterInputs: any) => {
|
||||
const filterProps = filterInputs.reduce(function (acc, cur, i) {
|
||||
acc[filterCommentsPropKeys[i]] = cur;
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
const {
|
||||
claimsById,
|
||||
myClaims,
|
||||
mutedChannels,
|
||||
personalBlockList,
|
||||
blacklistedMap,
|
||||
filteredMap,
|
||||
showMatureContent,
|
||||
} = filterProps;
|
||||
|
||||
return comments
|
||||
? comments.filter((comment) => {
|
||||
if (!comment) {
|
||||
// It may have been recently deleted after being blocked
|
||||
return false;
|
||||
}
|
||||
|
||||
const channelClaim = claimsById[comment.channel_id];
|
||||
|
||||
// Return comment if `channelClaim` doesn't exist so the component knows to resolve the author
|
||||
if (channelClaim) {
|
||||
if (myClaims && myClaims.size > 0) {
|
||||
const claimIsMine = channelClaim.is_my_output || myClaims.has(channelClaim.claim_id);
|
||||
if (claimIsMine) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
const outpoint = `${channelClaim.txid}:${channelClaim.nout}`;
|
||||
if (blacklistedMap[outpoint] || filteredMap[outpoint]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!showMatureContent) {
|
||||
const claimIsMature = isClaimNsfw(channelClaim);
|
||||
if (claimIsMature) {
|
||||
const makeSelectFilteredComments = (comments: Array<Comment>, claimId?: string) =>
|
||||
createSelector(
|
||||
selectClaimsById,
|
||||
selectMyActiveClaims,
|
||||
selectMutedChannels,
|
||||
selectModerationBlockList,
|
||||
selectAdminBlockList,
|
||||
selectModeratorBlockList,
|
||||
selectBlacklistedOutpointMap,
|
||||
selectFilteredOutpointMap,
|
||||
selectShowMatureContent,
|
||||
(
|
||||
claimsById,
|
||||
myClaims,
|
||||
mutedChannels,
|
||||
personalBlockList,
|
||||
adminBlockList,
|
||||
moderatorBlockList,
|
||||
blacklistedMap,
|
||||
filteredMap,
|
||||
showMatureContent
|
||||
) => {
|
||||
return comments
|
||||
? comments.filter((comment) => {
|
||||
if (!comment) {
|
||||
// It may have been recently deleted after being blocked
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (claimId) {
|
||||
const claimIdIsMine = myClaims && myClaims.size > 0 && myClaims.has(claimId);
|
||||
if (!claimIdIsMine) {
|
||||
if (personalBlockList.includes(comment.channel_url)) {
|
||||
return false;
|
||||
const channelClaim = claimsById[comment.channel_id];
|
||||
|
||||
// Return comment if `channelClaim` doesn't exist so the component knows to resolve the author
|
||||
if (channelClaim) {
|
||||
if (myClaims && myClaims.size > 0) {
|
||||
const claimIsMine = channelClaim.is_my_output || myClaims.has(channelClaim.claim_id);
|
||||
if (claimIsMine) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
const outpoint = `${channelClaim.txid}:${channelClaim.nout}`;
|
||||
if (blacklistedMap[outpoint] || filteredMap[outpoint]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!showMatureContent) {
|
||||
const claimIsMature = isClaimNsfw(channelClaim);
|
||||
if (claimIsMature) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !mutedChannels.includes(comment.channel_url);
|
||||
})
|
||||
: [];
|
||||
};
|
||||
if (claimId) {
|
||||
const claimIdIsMine = myClaims && myClaims.size > 0 && myClaims.has(claimId);
|
||||
if (!claimIdIsMine) {
|
||||
if (personalBlockList.includes(comment.channel_url) || adminBlockList.includes(comment.channel_url)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !mutedChannels.includes(comment.channel_url);
|
||||
})
|
||||
: [];
|
||||
}
|
||||
);
|
||||
|
||||
export const makeSelectTotalReplyPagesForParentId = (parentId: string) =>
|
||||
createSelector(selectState, (state) => {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// @flow
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
type State = { tags: TagState };
|
||||
|
||||
const selectState = (state: State) => state.tags || {};
|
||||
const selectState = (state: { tags: TagState }) => state.tags || {};
|
||||
|
||||
export const selectKnownTagsByName = createSelector(selectState, (state: TagState): KnownTags => state.knownTags);
|
||||
|
||||
export const selectFollowedTagsList = (state: State) => selectState(state).followedTags;
|
||||
export const selectFollowedTagsList = createSelector(selectState, (state: TagState): Array<string> =>
|
||||
state.followedTags.filter(tag => typeof tag === 'string')
|
||||
);
|
||||
|
||||
export const selectFollowedTags = createSelector(selectFollowedTagsList, (followedTags: Array<string>): Array<Tag> =>
|
||||
followedTags.map((tag) => ({ name: tag.toLowerCase() })).sort((a, b) => a.name.localeCompare(b.name))
|
||||
followedTags.map(tag => ({ name: tag.toLowerCase() })).sort((a, b) => a.name.localeCompare(b.name))
|
||||
);
|
||||
|
||||
export const selectUnfollowedTags = createSelector(
|
||||
@@ -19,7 +19,7 @@ export const selectUnfollowedTags = createSelector(
|
||||
(tagsByName: KnownTags, followedTags: Array<string>): Array<Tag> => {
|
||||
const followedTagsSet = new Set(followedTags);
|
||||
let tagsToReturn = [];
|
||||
Object.keys(tagsByName).forEach((key) => {
|
||||
Object.keys(tagsByName).forEach(key => {
|
||||
if (!followedTagsSet.has(key)) {
|
||||
const { name } = tagsByName[key];
|
||||
tagsToReturn.push({ name: name.toLowerCase() });
|
||||
@@ -31,6 +31,6 @@ export const selectUnfollowedTags = createSelector(
|
||||
);
|
||||
|
||||
export const makeSelectIsFollowingTag = (tag: string) =>
|
||||
createSelector(selectFollowedTags, (followedTags) => {
|
||||
return followedTags.some((followedTag) => followedTag.name === tag.toLowerCase());
|
||||
createSelector(selectFollowedTags, followedTags => {
|
||||
return followedTags.some(followedTag => followedTag.name === tag.toLowerCase());
|
||||
});
|
||||
@@ -13,8 +13,7 @@
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
padding: var(--spacing-m);
|
||||
padding-left: 0;
|
||||
padding-bottom: 0;
|
||||
padding-bottom: var(--spacing-s);
|
||||
margin-top: var(--spacing-m);
|
||||
margin-bottom: var(--spacing-m);
|
||||
color: var(--color-text-subtitle);
|
||||
@@ -42,14 +41,17 @@
|
||||
flex-direction: column;
|
||||
font-size: var(--font-body);
|
||||
width: 100%;
|
||||
margin-bottom: var(--spacing-m);
|
||||
|
||||
&:not(:first-of-type) {
|
||||
margin-top: var(--spacing-s);
|
||||
}
|
||||
|
||||
@media (min-width: $breakpoint-small) {
|
||||
width: auto;
|
||||
margin-top: 0;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
padding-right: var(--spacing-m);
|
||||
&:not(:first-of-type) {
|
||||
margin-top: 0;
|
||||
padding-left: var(--spacing-m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,18 +437,3 @@
|
||||
// scrollbar for all browsers.
|
||||
background-color: var(--color-scrollbar-thumb-bg);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: var(--color-scrollbar-thumb-bg);
|
||||
border-radius: 10px;
|
||||
}
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
.media__info-text--contracted {
|
||||
margin-top: var(--spacing-m);
|
||||
max-height: 5rem;
|
||||
max-height: 3rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
}
|
||||
|
||||
.media__info-text--fade {
|
||||
-webkit-mask-image: -webkit-gradient(linear, left 55%, left bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0)));
|
||||
-webkit-mask-image: -webkit-gradient(linear, left 30%, left bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0)));
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ export function GetLinksData(
|
||||
)}`,
|
||||
options: {
|
||||
claimType: ['stream'],
|
||||
orderBy: CS.ORDER_BY_NEW_VALUE,
|
||||
orderBy: ['release_time'],
|
||||
pageSize: getPageSize(12),
|
||||
channelIds: YOUTUBER_CHANNEL_IDS,
|
||||
limitClaimsPerChannel: 1,
|
||||
@@ -248,7 +248,7 @@ export function GetLinksData(
|
||||
link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_DAY}`,
|
||||
options: {
|
||||
pageSize: getPageSize(showPersonalizedChannels || showPersonalizedTags ? 4 : 8),
|
||||
orderBy: CS.ORDER_BY_TOP_VALUE,
|
||||
orderBy: ['effective_amount'],
|
||||
claimType: ['stream'],
|
||||
limitClaimsPerChannel: 2,
|
||||
releaseTime: `>${Math.floor(moment().subtract(1, 'day').startOf('day').unix())}`,
|
||||
@@ -259,7 +259,7 @@ export function GetLinksData(
|
||||
title: __('Top Channels On LBRY'),
|
||||
link: `/$/${PAGES.DISCOVER}?claim_type=channel&${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_ALL}`,
|
||||
options: {
|
||||
orderBy: CS.ORDER_BY_TOP_VALUE,
|
||||
orderBy: ['effective_amount'],
|
||||
claimType: ['channel'],
|
||||
},
|
||||
};
|
||||
@@ -268,7 +268,7 @@ export function GetLinksData(
|
||||
title: __('Latest From @lbry'),
|
||||
link: `/@lbry:3f`,
|
||||
options: {
|
||||
orderBy: CS.ORDER_BY_NEW_VALUE,
|
||||
orderBy: ['release_time'],
|
||||
pageSize: getPageSize(4),
|
||||
channelIds: ['3fda836a92faaceedfe398225fb9b2ee2ed1f01a'],
|
||||
},
|
||||
|
||||
@@ -13179,11 +13179,6 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.8:
|
||||
minimist "^1.2.0"
|
||||
strip-json-comments "~2.0.1"
|
||||
|
||||
re-reselect@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/re-reselect/-/re-reselect-4.0.0.tgz#9ddec4c72c4d952f68caa5aa4b76a9ed38b75cac"
|
||||
integrity sha512-wuygyq8TXUlSdVXv2kigXxQNOgdb9m7LbIjwfTNGSpaY1riLd5e+VeQjlQMyUtrk0oiyhi1AqIVynworl3qxHA==
|
||||
|
||||
react-async-script@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/react-async-script/-/react-async-script-1.1.1.tgz#f481c6c5f094bf4b94a9d52da0d0dda2e1a74bdf"
|
||||
|
||||
Reference in new issue
Block a user