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
-17
@@ -10,18 +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))
|
||||
- Setting to upgrade to alpha prerelease builds ([#7353](https://github.com/lbryio/lbry-desktop/pull/7353))
|
||||
- Support for macOS arm64
|
||||
- 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))
|
||||
@@ -31,12 +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))
|
||||
- Remove pages for obsolete features like invites, rewards, swap ([#7330](https://github.com/lbryio/lbry-desktop/pull/7330))
|
||||
- Change file repost to modal _community pr!_ ([#7341](https://github.com/lbryio/lbry-desktop/pull/7341))
|
||||
- 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))
|
||||
@@ -46,9 +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))
|
||||
- Fix floating player play/pause on drag _community pr!_ ([#7339](https://github.com/lbryio/lbry-desktop/pull/7339))
|
||||
- Fix card dropdown menus triggering menu actions _community pr!_ ([#7335](https://github.com/lbryio/lbry-desktop/pull/7335))
|
||||
|
||||
## [0.51.2] - [2021-08-20]
|
||||
|
||||
|
||||
+8
-12
@@ -20,6 +20,11 @@
|
||||
"to": "static/daemon/",
|
||||
"filter": ["**/*"]
|
||||
},
|
||||
{
|
||||
"from": "./static/lbry-first/",
|
||||
"to": "static/lbry-first/",
|
||||
"filter": ["**/*"]
|
||||
},
|
||||
{
|
||||
"from": "./static/img",
|
||||
"to": "static/img",
|
||||
@@ -37,16 +42,7 @@
|
||||
}
|
||||
],
|
||||
"mac": {
|
||||
"category": "public.app-category.entertainment",
|
||||
"target": [
|
||||
{
|
||||
"target": "default",
|
||||
"arch": [
|
||||
"x64",
|
||||
"arm64"
|
||||
]
|
||||
}
|
||||
],
|
||||
"category": "public.app-category.entertainment"
|
||||
},
|
||||
"dmg": {
|
||||
"iconSize": 128,
|
||||
@@ -68,7 +64,7 @@
|
||||
"width": 500,
|
||||
"height": 300
|
||||
},
|
||||
"background": "./build/background.png",
|
||||
"background": "./build/background.png"
|
||||
},
|
||||
"protocols": [
|
||||
{
|
||||
@@ -86,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;
|
||||
+10
-8
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lbry",
|
||||
"version": "0.52.0-alpha.10",
|
||||
"version": "0.52.0-rc.5",
|
||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||
"keywords": [
|
||||
"lbry"
|
||||
@@ -49,20 +49,22 @@
|
||||
"electron-dl": "^3.2.0",
|
||||
"electron-log": "^2.2.12",
|
||||
"electron-notarize": "^1.0.0",
|
||||
"electron-updater": "^4.6.5",
|
||||
"electron-updater": "^4.2.4",
|
||||
"express": "^4.17.1",
|
||||
"humanize-duration": "^3.27.0",
|
||||
"if-env": "^1.0.4",
|
||||
"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",
|
||||
"remove-markdown": "^0.3.0",
|
||||
"rss": "^1.2.2",
|
||||
"source-map-explorer": "^2.5.2",
|
||||
"tempy": "^0.6.0",
|
||||
"videojs-contrib-ads": "^6.9.0",
|
||||
"videojs-ima": "^1.11.0",
|
||||
"videojs-logo": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -106,7 +108,7 @@
|
||||
"codemirror": "^5.39.2",
|
||||
"concurrently": "^4.1.2",
|
||||
"connected-react-router": "^6.8.0",
|
||||
"copy-webpack-plugin": "^6.4.1",
|
||||
"copy-webpack-plugin": "^5.1.2",
|
||||
"copyfiles": "^2.4.1",
|
||||
"country-data": "^0.0.31",
|
||||
"cross-env": "^7.0.3",
|
||||
@@ -122,7 +124,7 @@
|
||||
"dotenv-defaults": "^2.0.1",
|
||||
"dotenv-webpack": "^1.8.0",
|
||||
"electron": "11.5.0",
|
||||
"electron-builder": "^22.14.5",
|
||||
"electron-builder": "^22.9.1",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"electron-is-dev": "^0.3.0",
|
||||
"electron-webpack": "^2.8.2",
|
||||
@@ -205,7 +207,7 @@
|
||||
"stream-to-blob-url": "^2.1.1",
|
||||
"strip-markdown": "^3.0.3",
|
||||
"style-loader": "^0.23.1",
|
||||
"terser-webpack-plugin": "^4.2.3",
|
||||
"terser-webpack-plugin": "^1.2.3",
|
||||
"three": "^0.125.0",
|
||||
"three-full": "^17.1.0",
|
||||
"tiny-relative-date": "^1.3.0",
|
||||
@@ -218,7 +220,7 @@
|
||||
"videojs-event-tracking": "^1.0.1",
|
||||
"villain-react": "^1.0.9",
|
||||
"wavesurfer.js": "^2.2.1",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack": "^4.28.4",
|
||||
"webpack-bundle-analyzer": "^3.1.0",
|
||||
"webpack-cli": "^3.3.10",
|
||||
"webpack-config-utils": "^2.3.1",
|
||||
@@ -235,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,20 +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%",
|
||||
"Buy LBC": "Buy LBC",
|
||||
"This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you connect to a cloud service)": "This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you connect to a cloud service)",
|
||||
"Use official LBRY wallet servers": "Use official LBRY wallet servers",
|
||||
"Enable Prerelease Updates": "Enable Prerelease Updates",
|
||||
"Enable Upgrade to Test Builds": "Enable Upgrade to Test Builds",
|
||||
"Prereleases may break things and we may not be able to fix them for you.": "Prereleases may break things and we may not be able to fix them for you.",
|
||||
"Limit (GB)": "Limit (GB)",
|
||||
"Limit Hosting for Content you Use": "Limit Hosting for Content you Use",
|
||||
"Allow (GB)": "Allow (GB)",
|
||||
"Content Data Hosting helps to seed things that you watch and download.": "Content Data Hosting helps to seed things that you watch and download.",
|
||||
"Network Data Hosting allows the p2p network to store blobs unrelated to your browsing.": "Network Data Hosting allows the p2p network to store blobs unrelated to your browsing.",
|
||||
"Content: Limit (GB)": "Content: Limit (GB)",
|
||||
"Network: Allow (GB)": "Network: Allow (GB)",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -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">
|
||||
|
||||
@@ -265,34 +265,15 @@ function ClaimMenuList(props: Props) {
|
||||
push(`/$/${PAGES.REPORT_CONTENT}?claimId=${contentClaim && contentClaim.claim_id}`);
|
||||
}
|
||||
|
||||
// changes MenuButton behavior to show/hide MenuList not on press but on click event
|
||||
let isEventSimulated = false;
|
||||
const menuButtonHandler = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
e.type = 'click';
|
||||
}
|
||||
if (!isEventSimulated && e.type === 'mousedown') {
|
||||
e.preventDefault();
|
||||
} else if (e.type === 'click') {
|
||||
isEventSimulated = true;
|
||||
e.target.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
|
||||
isEventSimulated = false;
|
||||
}
|
||||
};
|
||||
|
||||
const shouldShow = !IS_WEB || (IS_WEB && isAuthenticated);
|
||||
return (
|
||||
<Menu>
|
||||
<MenuButton
|
||||
className={classnames('menu__button', { 'claim__menu-button': !inline, 'claim__menu-button--inline': inline })}
|
||||
onMouseDown={menuButtonHandler}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
menuButtonHandler(e);
|
||||
}}
|
||||
onKeyDown={menuButtonHandler}
|
||||
>
|
||||
<Icon size={20} icon={ICONS.MORE_VERTICAL} />
|
||||
</MenuButton>
|
||||
|
||||
@@ -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,6 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import ClaimReportButton from './view';
|
||||
|
||||
export default connect(null, { doOpenModal, doToast })(ClaimReportButton);
|
||||
@@ -1,44 +0,0 @@
|
||||
// @flow
|
||||
import { SITE_NAME } from 'config';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: StreamClaim,
|
||||
hasChannels: boolean,
|
||||
doOpenModal: (string, {}) => void,
|
||||
doToast: ({ message: string }) => void,
|
||||
};
|
||||
|
||||
export default function ClaimRepostButton(props: Props) {
|
||||
const { uri, claim, hasChannels, doOpenModal, doToast } = props;
|
||||
const [contentUri, setContentUri] = React.useState('');
|
||||
const [repostUri, setRepostUri] = React.useState('');
|
||||
|
||||
return (
|
||||
<Button
|
||||
button="alt"
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPOST}
|
||||
label={
|
||||
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
|
||||
}
|
||||
description={__('Repost')}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={() => {
|
||||
if (!hasChannels) {
|
||||
doToast({
|
||||
message: __('A channel is required to repost on %SITE_NAME%', { SITE_NAME }),
|
||||
linkText: __('Create Channel'),
|
||||
linkTarget: '/channel/new',
|
||||
});
|
||||
} else {
|
||||
doOpenModal(MODALS.REPOST, { uri, contentUri, setContentUri, repostUri, setRepostUri, isModal: true });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -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),
|
||||
|
||||
@@ -513,7 +513,7 @@ export function CommentCreate(props: Props) {
|
||||
)}
|
||||
<FormField
|
||||
disabled={isFetchingChannels}
|
||||
type={advancedEditor ? 'markdown' : 'textarea'}
|
||||
type={'textarea'}
|
||||
name={isReply ? 'content_reply' : 'content_description'}
|
||||
ref={formFieldRef}
|
||||
className={isReply ? 'content_reply' : 'content_comment'}
|
||||
|
||||
@@ -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);
|
||||
@@ -1,5 +1,5 @@
|
||||
// @flow
|
||||
import { ENABLE_FILE_REACTIONS } from 'config';
|
||||
import { SITE_NAME, ENABLE_FILE_REACTIONS } from 'config';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
@@ -16,7 +16,6 @@ import { useHistory } from 'react-router';
|
||||
import FileReactions from 'component/fileReactions';
|
||||
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
|
||||
import Icon from 'component/common/icon';
|
||||
import ClaimRepostButton from 'component/claimRepostButton';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -28,6 +27,8 @@ type Props = {
|
||||
costInfo: ?{ cost: number },
|
||||
renderMode: string,
|
||||
myChannels: ?Array<ChannelClaim>,
|
||||
doToast: ({ message: string }) => void,
|
||||
clearPlayingUri: () => void,
|
||||
hideRepost?: boolean,
|
||||
reactionsDisabled: boolean,
|
||||
download: (string) => void,
|
||||
@@ -45,12 +46,14 @@ function FileActions(props: Props) {
|
||||
renderMode,
|
||||
prepareEdit,
|
||||
myChannels,
|
||||
clearPlayingUri,
|
||||
doToast,
|
||||
hideRepost,
|
||||
reactionsDisabled,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
location: { search },
|
||||
location: { pathname, search },
|
||||
} = useHistory();
|
||||
const isMobile = useIsMobile();
|
||||
const webShareable = costInfo && costInfo.cost === 0 && RENDER_MODES.WEB_SHAREABLE_MODES.includes(renderMode);
|
||||
@@ -79,13 +82,33 @@ function FileActions(props: Props) {
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const collectionId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID);
|
||||
|
||||
function handleRepostClick() {
|
||||
if (!hasChannels) {
|
||||
clearPlayingUri();
|
||||
push(`/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`);
|
||||
doToast({ message: __('A channel is required to repost on %SITE_NAME%', { SITE_NAME }) });
|
||||
} else {
|
||||
push(`/$/${PAGES.REPOST_NEW}?from=${encodeURIComponent(uri)}&redirect=${pathname}`);
|
||||
}
|
||||
}
|
||||
|
||||
const lhsSection = (
|
||||
<>
|
||||
{ENABLE_FILE_REACTIONS && !reactionsDisabled && <FileReactions uri={uri} />}
|
||||
<ClaimSupportButton uri={uri} fileAction />
|
||||
<ClaimCollectionAddButton uri={uri} fileAction />
|
||||
{!hideRepost && (
|
||||
<ClaimRepostButton uri={uri} claim={claim} hasChannels={hasChannels} />
|
||||
<Button
|
||||
button="alt"
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPOST}
|
||||
label={
|
||||
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
|
||||
}
|
||||
description={__('Repost')}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={handleRepostClick}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
className="button--file-action"
|
||||
|
||||
@@ -11,7 +11,6 @@ import { doSignOut, doOpenModal } from 'redux/actions/app';
|
||||
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
|
||||
import { selectHasNavigated, selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
import Header from './view';
|
||||
import { selectMyChannelClaims } from 'redux/selectors/claims';
|
||||
|
||||
const select = (state) => ({
|
||||
language: selectLanguage(state),
|
||||
@@ -28,7 +27,6 @@ const select = (state) => ({
|
||||
hasNavigated: selectHasNavigated(state),
|
||||
user: selectUser(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
||||
@@ -63,7 +63,6 @@ type Props = {
|
||||
isAbsoluteSideNavHidden: boolean,
|
||||
hideCancel: boolean,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
myChannels: ?Array<ChannelClaim>,
|
||||
};
|
||||
|
||||
const Header = (props: Props) => {
|
||||
@@ -92,7 +91,6 @@ const Header = (props: Props) => {
|
||||
hideCancel,
|
||||
user,
|
||||
activeChannelClaim,
|
||||
myChannels,
|
||||
} = props;
|
||||
const isMobile = useIsMobile();
|
||||
// on the verify page don't let anyone escape other than by closing the tab to keep session data consistent
|
||||
@@ -104,7 +102,6 @@ const Header = (props: Props) => {
|
||||
const { backLabel, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {};
|
||||
const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui);
|
||||
const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url;
|
||||
const hasChannels = myChannels && myChannels.length > 0;
|
||||
|
||||
// Sign out if they click the "x" when they are on the password prompt
|
||||
const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' };
|
||||
@@ -326,12 +323,19 @@ const Header = (props: Props) => {
|
||||
<Icon aria-hidden icon={ICONS.CHANNEL} />
|
||||
{__('Channels')}
|
||||
</MenuItem>
|
||||
{hasChannels && (
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.CREATOR_DASHBOARD}`)}>
|
||||
<Icon aria-hidden icon={ICONS.ANALYTICS} />
|
||||
{__('Creator Analytics')}
|
||||
</MenuItem>
|
||||
)}
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.CREATOR_DASHBOARD}`)}>
|
||||
<Icon aria-hidden icon={ICONS.ANALYTICS} />
|
||||
{__('Creator Analytics')}
|
||||
</MenuItem>
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.REWARDS}`)}>
|
||||
<Icon aria-hidden icon={ICONS.REWARDS} />
|
||||
{__('Rewards')}
|
||||
</MenuItem>
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.INVITE}`)}>
|
||||
<Icon aria-hidden icon={ICONS.INVITE} />
|
||||
{__('Invites')}
|
||||
</MenuItem>
|
||||
|
||||
{authenticated ? (
|
||||
<MenuItem onSelect={IS_WEB ? signOut : openSignOutModal}>
|
||||
<div className="menu__link">
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
selectUserInviteReferralLink,
|
||||
selectUserInviteReferralCode,
|
||||
} from 'redux/selectors/user';
|
||||
// import { doUserInviteNew } from 'redux/actions/user';
|
||||
import { doUserInviteNew } from 'redux/actions/user';
|
||||
import { selectMyChannelClaims, selectFetchingMyChannels } from 'redux/selectors/claims';
|
||||
import { doFetchChannelListMine } from 'redux/actions/claims';
|
||||
import InviteNew from './view';
|
||||
@@ -22,7 +22,7 @@ const select = (state) => ({
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
// inviteNew: (email) => dispatch(doUserInviteNew(email)),
|
||||
inviteNew: (email) => dispatch(doUserInviteNew(email)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import { RULE } from 'constants/notifications';
|
||||
import React from 'react';
|
||||
@@ -48,6 +49,14 @@ export default function Notification(props: Props) {
|
||||
|
||||
let notificationTarget;
|
||||
switch (notification_rule) {
|
||||
case RULE.DAILY_WATCH_AVAILABLE:
|
||||
case RULE.DAILY_WATCH_REMIND:
|
||||
notificationTarget = `/$/${PAGES.CHANNELS_FOLLOWING}`;
|
||||
break;
|
||||
case RULE.MISSED_OUT:
|
||||
case RULE.REWARDS_APPROVAL_PROMPT:
|
||||
notificationTarget = `/$/${PAGES.REWARDS_VERIFY}?redirect=/$/${PAGES.REWARDS}`;
|
||||
break;
|
||||
default:
|
||||
notificationTarget = notification_parameters.device.target;
|
||||
}
|
||||
@@ -78,6 +87,12 @@ export default function Notification(props: Props) {
|
||||
channelUrl = notification_parameters.dynamic.channel_url;
|
||||
icon = creatorIcon(channelUrl);
|
||||
break;
|
||||
case RULE.DAILY_WATCH_AVAILABLE:
|
||||
case RULE.DAILY_WATCH_REMIND:
|
||||
case RULE.MISSED_OUT:
|
||||
case RULE.REWARDS_APPROVAL_PROMPT:
|
||||
icon = <Icon icon={ICONS.LBC} sectionIcon />;
|
||||
break;
|
||||
case RULE.FIAT_TIP:
|
||||
icon = <Icon icon={ICONS.FINANCE} sectionIcon />;
|
||||
break;
|
||||
|
||||
@@ -146,7 +146,7 @@ function PublishForm(props: Props) {
|
||||
} else if (_uploadType) {
|
||||
return mode === _uploadType;
|
||||
} else {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ type Props = {
|
||||
doToast: ({ message: string }) => void,
|
||||
doClearRepostError: () => void,
|
||||
doRepost: (StreamRepostOptions) => Promise<*>,
|
||||
doHideModal: () => void,
|
||||
title: string,
|
||||
claim?: StreamClaim,
|
||||
enteredContentClaim?: StreamClaim,
|
||||
@@ -34,7 +33,11 @@ type Props = {
|
||||
reposting: boolean,
|
||||
uri: string,
|
||||
name: string,
|
||||
contentUri: string,
|
||||
setRepostUri: (string) => void,
|
||||
setContentUri: (string) => void,
|
||||
doCheckPendingClaims: () => void,
|
||||
redirectUri?: string,
|
||||
passedRepostAmount: number,
|
||||
enteredRepostAmount: number,
|
||||
isResolvingPassedRepost: boolean,
|
||||
@@ -42,16 +45,11 @@ type Props = {
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
fetchingMyChannels: boolean,
|
||||
incognito: boolean,
|
||||
contentUri: string,
|
||||
setContentUri: (string) => void,
|
||||
repostUri: string,
|
||||
setRepostUri: (string) => void,
|
||||
isModal: boolean,
|
||||
redirectUri?: string,
|
||||
};
|
||||
|
||||
function RepostCreate(props: Props) {
|
||||
const {
|
||||
redirectUri,
|
||||
doToast,
|
||||
doClearRepostError,
|
||||
doRepost,
|
||||
@@ -62,6 +60,9 @@ function RepostCreate(props: Props) {
|
||||
doCheckPublishNameAvailability,
|
||||
uri, // ?from
|
||||
name, // ?to
|
||||
contentUri,
|
||||
setRepostUri,
|
||||
setContentUri,
|
||||
doCheckPendingClaims,
|
||||
enteredRepostAmount,
|
||||
passedRepostAmount,
|
||||
@@ -70,12 +71,6 @@ function RepostCreate(props: Props) {
|
||||
activeChannelClaim,
|
||||
fetchingMyChannels,
|
||||
incognito,
|
||||
doHideModal,
|
||||
contentUri,
|
||||
setContentUri,
|
||||
setRepostUri,
|
||||
isModal,
|
||||
redirectUri,
|
||||
} = props;
|
||||
|
||||
const defaultName = name || (claim && claim.name) || '';
|
||||
@@ -88,8 +83,8 @@ function RepostCreate(props: Props) {
|
||||
const [available, setAvailable] = React.useState(true);
|
||||
const [enteredContent, setEnteredContentUri] = React.useState(undefined);
|
||||
const [contentError, setContentError] = React.useState('');
|
||||
const { replace, goBack } = useHistory();
|
||||
|
||||
const { replace, goBack } = useHistory();
|
||||
const resolvingRepost = isResolvingEnteredRepost || isResolvingPassedRepost;
|
||||
const repostUrlName = `lbry://${incognito || !activeChannelClaim ? '' : `${activeChannelClaim.name}/`}`;
|
||||
|
||||
@@ -298,22 +293,14 @@ function RepostCreate(props: Props) {
|
||||
linkText: __('Uploads'),
|
||||
linkTarget: '/uploads',
|
||||
});
|
||||
if (isModal) {
|
||||
doHideModal();
|
||||
} else {
|
||||
replace(getRedirect(contentUri, uri, redirectUri));
|
||||
}
|
||||
replace(getRedirect(contentUri, uri, redirectUri));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cancelIt() {
|
||||
doClearRepostError();
|
||||
if (isModal) {
|
||||
doHideModal();
|
||||
} else {
|
||||
goBack();
|
||||
}
|
||||
goBack();
|
||||
}
|
||||
|
||||
if (fetchingMyChannels) {
|
||||
@@ -326,10 +313,11 @@ function RepostCreate(props: Props) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ChannelSelector />
|
||||
|
||||
<Card
|
||||
actions={
|
||||
<div>
|
||||
<ChannelSelector />
|
||||
{uri && (
|
||||
<fieldset-section>
|
||||
<ClaimPreview key={uri} uri={uri} actions={''} showNullPlaceholder />
|
||||
|
||||
@@ -6,7 +6,7 @@ import * as PAGES from 'constants/pages';
|
||||
import { PAGE_TITLE } from 'constants/pageTitles';
|
||||
import { LINKED_COMMENT_QUERY_PARAM } from 'constants/comment';
|
||||
import { parseURI, isURIValid } from 'util/lbryURI';
|
||||
import { WELCOME_VERSION } from 'config';
|
||||
import { SITE_TITLE, WELCOME_VERSION } from 'config';
|
||||
import { GetLinksData } from 'util/buildHomepage';
|
||||
|
||||
import HomePage from 'page/home';
|
||||
@@ -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
|
||||
@@ -38,6 +39,8 @@ import DiscoverPage from 'page/discover';
|
||||
import FileListPublished from 'page/fileListPublished';
|
||||
import FourOhFourPage from 'page/fourOhFour';
|
||||
import HelpPage from 'page/help';
|
||||
import InvitePage from 'page/invite';
|
||||
import InvitedPage from 'page/invited';
|
||||
import LibraryPage from 'page/library';
|
||||
import ListBlockedPage from 'page/listBlocked';
|
||||
import ListsPage from 'page/lists';
|
||||
@@ -49,6 +52,8 @@ import PublishPage from 'page/publish';
|
||||
import ReportContentPage from 'page/reportContent';
|
||||
import ReportPage from 'page/report';
|
||||
import RepostNew from 'page/repost';
|
||||
import RewardsPage from 'page/rewards';
|
||||
import RewardsVerifyPage from 'page/rewardsVerify';
|
||||
import SearchPage from 'page/search';
|
||||
|
||||
import SettingsCreatorPage from 'page/settingsCreator';
|
||||
@@ -62,6 +67,7 @@ import TagsFollowingPage from 'page/tagsFollowing';
|
||||
import TopPage from 'page/top';
|
||||
import UpdatePasswordPage from 'page/passwordUpdate';
|
||||
import Welcome from 'page/welcome';
|
||||
import YoutubeSyncPage from 'page/youtubeSync';
|
||||
|
||||
// Tell the browser we are handling scroll restoration
|
||||
if ('scrollRestoration' in history) {
|
||||
@@ -169,7 +175,7 @@ function AppRouter(props: Props) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
return uri || pathname || title;
|
||||
}
|
||||
return __(title) || 'LBRY';
|
||||
return __(title) || (IS_WEB ? SITE_TITLE : 'LBRY');
|
||||
};
|
||||
|
||||
if (uri) {
|
||||
@@ -254,9 +260,11 @@ function AppRouter(props: Props) {
|
||||
<Route path={`/$/${PAGES.SEARCH}`} exact component={SearchPage} />
|
||||
<Route path={`/$/${PAGES.TOP}`} exact component={TopPage} />
|
||||
<Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} />
|
||||
<Route path={`/$/${PAGES.INVITE}/:referrer`} exact component={InvitedPage} />
|
||||
<Route path={`/$/${PAGES.REPORT_CONTENT}`} exact component={ReportContentPage} />
|
||||
<Route {...props} path={`/$/${PAGES.LIST}/:collectionId`} component={CollectionPage} />
|
||||
|
||||
<PrivateRoute {...props} exact path={`/$/${PAGES.YOUTUBE_SYNC}`} component={YoutubeSyncPage} />
|
||||
<PrivateRoute {...props} exact path={`/$/${PAGES.TAGS_FOLLOWING}`} component={TagsFollowingPage} />
|
||||
<PrivateRoute
|
||||
{...props}
|
||||
@@ -272,12 +280,15 @@ function AppRouter(props: Props) {
|
||||
path={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`}
|
||||
component={ChannelsFollowingDiscoverPage}
|
||||
/>
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.INVITE}`} component={InvitePage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.CHANNEL_NEW}`} component={ChannelNew} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REPOST_NEW}`} component={RepostNew} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.UPLOADS}`} component={FileListPublished} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.CREATOR_DASHBOARD}`} component={CreatorDashboard} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.UPLOAD}`} component={PublishPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REPORT}`} component={ReportPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS}`} exact component={RewardsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS_VERIFY}`} component={RewardsVerifyPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.LIBRARY}`} component={LibraryPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.LISTS}`} component={ListsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.PLAYLISTS}`} component={PlaylistsPage} />
|
||||
@@ -289,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,17 +0,0 @@
|
||||
import SettingEnablePrereleases from './view';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
|
||||
const select = (state) => {
|
||||
return {
|
||||
enablePrereleases: makeSelectClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES)(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
setClientSetting: (value) => dispatch(doSetClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES, value)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(SettingEnablePrereleases);
|
||||
@@ -1,25 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { FormField } from 'component/common/form';
|
||||
|
||||
type Props = {
|
||||
setClientSetting: (boolean) => void,
|
||||
enablePrereleases: boolean,
|
||||
};
|
||||
function SettingEnablePrereleases(props: Props) {
|
||||
const { setClientSetting, enablePrereleases } = props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<FormField
|
||||
type="checkbox"
|
||||
name="prereleases"
|
||||
onChange={() => {
|
||||
setClientSetting(!enablePrereleases);
|
||||
}}
|
||||
checked={enablePrereleases}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default SettingEnablePrereleases;
|
||||
@@ -17,9 +17,10 @@ import Spinner from 'component/spinner';
|
||||
import { getPasswordFromCookie } from 'util/saved-passwords';
|
||||
import * as DAEMON_SETTINGS from 'constants/daemon_settings';
|
||||
import { formatBytes } from 'util/format-bytes';
|
||||
import SettingEnablePrereleases from 'component/settingEnablePrereleases';
|
||||
|
||||
// @if TARGET='app'
|
||||
const IS_MAC = process.platform === 'darwin';
|
||||
// @endif
|
||||
const BYTES_PER_MB = 1048576;
|
||||
|
||||
type Price = {
|
||||
@@ -41,11 +42,8 @@ type DaemonSettings = {
|
||||
|
||||
type DaemonStatus = {
|
||||
disk_space: {
|
||||
content_blobs_storage_used_mb: string,
|
||||
published_blobs_storage_used_mb: string,
|
||||
running: true,
|
||||
seed_blobs_storage_used_mb: string,
|
||||
total_used_mb: string,
|
||||
running: boolean,
|
||||
space_used: string,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -93,18 +91,15 @@ export default function SettingSystem(props: Props) {
|
||||
const [clearingCache, setClearingCache] = React.useState(false);
|
||||
const [storedPassword, setStoredPassword] = React.useState(false);
|
||||
const { disk_space } = daemonStatus;
|
||||
const contentSpaceUsed = Number(disk_space.content_blobs_storage_used_mb);
|
||||
const networkSpaceUsed = Number(disk_space.seed_blobs_storage_used_mb);
|
||||
const spaceUsed = Number(disk_space.space_used);
|
||||
const blobLimitSetting = daemonSettings[DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB];
|
||||
const networkLimitSetting = daemonSettings[DAEMON_SETTINGS.NETWORK_STORAGE_LIMIT_MB];
|
||||
const [contentBlobSpaceLimitGB, setContentBlobSpaceLimit] = React.useState(
|
||||
blobLimitSetting ? blobLimitSetting / 1024 : 0
|
||||
);
|
||||
const [networkBlobSpaceLimitGB, setNetworkBlobSpaceLimit] = React.useState(
|
||||
networkLimitSetting ? networkLimitSetting / 1024 : 0
|
||||
);
|
||||
const [blobSpaceLimitGB, setBlobSpaceLimit] = React.useState(blobLimitSetting ? blobLimitSetting / 1024 : 0);
|
||||
// const debouncedBlobSpaceLimitGB = useDebounce(blobSpaceLimitGB || 0, 500);
|
||||
const [limitSpace, setLimitSpace] = React.useState(Boolean(blobLimitSetting));
|
||||
console.log('spaceUsed', spaceUsed, 'blobLimit', blobLimitSetting);
|
||||
// @if TARGET='app'
|
||||
const { available: ffmpegAvailable, which: ffmpegPath } = ffmpegStatus;
|
||||
// @endif
|
||||
|
||||
function onChangeEncryptWallet() {
|
||||
if (walletEncrypted) {
|
||||
@@ -118,19 +113,11 @@ export default function SettingSystem(props: Props) {
|
||||
confirmForgetPassword({ callback: () => setStoredPassword(false) });
|
||||
}
|
||||
|
||||
function updateContentBlobLimitField(gb) {
|
||||
function updateBlobLimitField(gb) {
|
||||
if (gb === 0) {
|
||||
setContentBlobSpaceLimit(0);
|
||||
setBlobSpaceLimit(0);
|
||||
} else if (!gb || !isNaN(gb)) {
|
||||
setContentBlobSpaceLimit(gb);
|
||||
}
|
||||
}
|
||||
|
||||
function updateNetworkBlobLimitField(gb) {
|
||||
if (gb === 0) {
|
||||
setNetworkBlobSpaceLimit(0);
|
||||
} else if (!gb || !isNaN(gb)) {
|
||||
setNetworkBlobSpaceLimit(gb);
|
||||
setBlobSpaceLimit(gb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,27 +126,21 @@ export default function SettingSystem(props: Props) {
|
||||
if (!value) {
|
||||
setDaemonSetting(DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB, String(0));
|
||||
} else {
|
||||
const spaceLimitMB = contentBlobSpaceLimitGB * 1024;
|
||||
const spaceLimitMB = blobSpaceLimitGB * 1024;
|
||||
setDaemonSetting(DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB, String(spaceLimitMB));
|
||||
}
|
||||
}
|
||||
|
||||
function handleSetContentBlobSpaceLimit() {
|
||||
const spaceLimitMB = contentBlobSpaceLimitGB * 1024;
|
||||
function handleSetBlobSpaceLimit() {
|
||||
const spaceLimitMB = blobSpaceLimitGB * 1024;
|
||||
if (!isNaN(spaceLimitMB) && blobLimitSetting !== spaceLimitMB * 1024) {
|
||||
setDaemonSetting(DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB, String(spaceLimitMB));
|
||||
}
|
||||
}
|
||||
|
||||
function handleSetNetworkBlobSpaceLimit() {
|
||||
const spaceLimitMB = networkBlobSpaceLimitGB * 1024;
|
||||
if (!isNaN(spaceLimitMB) && blobLimitSetting !== spaceLimitMB * 1024) {
|
||||
setDaemonSetting(DAEMON_SETTINGS.NETWORK_STORAGE_LIMIT_MB, String(spaceLimitMB));
|
||||
}
|
||||
}
|
||||
|
||||
// Update ffmpeg variables
|
||||
React.useEffect(() => {
|
||||
// @if TARGET='app'
|
||||
const { available } = ffmpegStatus;
|
||||
const { ffmpeg_path: ffmpegPath } = daemonSettings;
|
||||
if (!available) {
|
||||
@@ -168,6 +149,7 @@ export default function SettingSystem(props: Props) {
|
||||
}
|
||||
findFFmpeg();
|
||||
}
|
||||
// @endif
|
||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
// Update storedPassword state
|
||||
@@ -204,6 +186,7 @@ export default function SettingSystem(props: Props) {
|
||||
</SettingsRow>
|
||||
{/* @endif */}
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
<SettingsRow
|
||||
title={__('Save all viewed content to your downloads directory')}
|
||||
subtitle={__(
|
||||
@@ -222,23 +205,16 @@ export default function SettingSystem(props: Props) {
|
||||
multirow
|
||||
subtitle={
|
||||
<React.Fragment>
|
||||
{__('Content Data Hosting helps to seed things that you watch and download.')}{' '}
|
||||
{__('Network Data Hosting allows the p2p network to store blobs unrelated to your browsing.')}{' '}
|
||||
{__("If disabled, LBRY will be very sad and you won't be helping improve the network.")}{' '}
|
||||
{__('If you set a limit, playing videos may exceed your limit until cleanup runs every 30 minutes.')}{' '}
|
||||
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/host-content" />.
|
||||
<p className={'help'}>
|
||||
{`Content Hosting using ${formatBytes(contentSpaceUsed * BYTES_PER_MB)} of ${
|
||||
{`Using ${formatBytes(spaceUsed * BYTES_PER_MB)} of ${
|
||||
daemonSettings[DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB]
|
||||
? formatBytes(daemonSettings[DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB] * BYTES_PER_MB)
|
||||
: 'Unlimited'
|
||||
}`}
|
||||
</p>
|
||||
<p className={'help'}>
|
||||
{`Network Hosting using ${formatBytes(networkSpaceUsed * BYTES_PER_MB)} of ${formatBytes(
|
||||
daemonSettings[DAEMON_SETTINGS.NETWORK_STORAGE_LIMIT_MB] * BYTES_PER_MB
|
||||
)}`}
|
||||
</p>
|
||||
</React.Fragment>
|
||||
}
|
||||
>
|
||||
@@ -251,55 +227,41 @@ export default function SettingSystem(props: Props) {
|
||||
label={__('Enable Data Hosting')}
|
||||
/>
|
||||
</fieldset-section>
|
||||
{daemonSettings.save_blobs && (
|
||||
<fieldset-section>
|
||||
<FormField
|
||||
type="checkbox"
|
||||
name="limit_space_used"
|
||||
onChange={() => handleLimitSpace(!limitSpace)}
|
||||
checked={limitSpace}
|
||||
label={__('Limit Hosting for Content you Use')}
|
||||
/>
|
||||
</fieldset-section>
|
||||
)}
|
||||
|
||||
{daemonSettings.save_blobs && limitSpace && (
|
||||
<fieldset-section>
|
||||
<FormField
|
||||
name="content_blob_limit_gb"
|
||||
type="text"
|
||||
label={__(`Content: Limit (GB)`)}
|
||||
disabled={!daemonSettings.save_blobs}
|
||||
onChange={(e) => updateContentBlobLimitField(e.target.value)}
|
||||
value={contentBlobSpaceLimitGB}
|
||||
inputButton={
|
||||
<Button
|
||||
disabled={isNaN(contentBlobSpaceLimitGB)}
|
||||
button="primary"
|
||||
label={__('Apply')}
|
||||
onClick={handleSetContentBlobSpaceLimit}
|
||||
/>
|
||||
}
|
||||
type="checkbox"
|
||||
name="limit_space_used"
|
||||
onChange={() => handleLimitSpace(!limitSpace)}
|
||||
checked={limitSpace}
|
||||
label={__('Limit Space Used')}
|
||||
/>
|
||||
)}
|
||||
{daemonSettings.save_blobs && (
|
||||
</fieldset-section>
|
||||
|
||||
{limitSpace && (
|
||||
<FormField
|
||||
name="network_blob_limit_gb"
|
||||
name="blob_limit_gb"
|
||||
type="text"
|
||||
label={__(`Network: Allow (GB)`)}
|
||||
label={__(`Limit (GB)`)}
|
||||
helper={__(
|
||||
'Data over the limit will be deleted within 30 minutes. This will make the Yrbl cry a little bit.'
|
||||
)}
|
||||
disabled={!daemonSettings.save_blobs}
|
||||
onChange={(e) => updateNetworkBlobLimitField(e.target.value)}
|
||||
value={networkBlobSpaceLimitGB}
|
||||
onChange={(e) => updateBlobLimitField(e.target.value)}
|
||||
value={blobSpaceLimitGB}
|
||||
inputButton={
|
||||
<Button
|
||||
disabled={isNaN(networkBlobSpaceLimitGB)}
|
||||
disabled={isNaN(blobSpaceLimitGB)}
|
||||
button="primary"
|
||||
label={__('Apply')}
|
||||
onClick={handleSetNetworkBlobSpaceLimit}
|
||||
onClick={handleSetBlobSpaceLimit}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</SettingsRow>
|
||||
{/* @endif */}
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
<SettingsRow
|
||||
title={__('Share usage and diagnostic data')}
|
||||
subtitle={
|
||||
@@ -334,6 +296,9 @@ export default function SettingSystem(props: Props) {
|
||||
helper={__('We use detailed analytics to improve all aspects of the LBRY experience.')}
|
||||
/>
|
||||
</SettingsRow>
|
||||
{/* @endif */}
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
{/* Auto launch in a hidden state doesn't work on mac https://github.com/Teamwork/node-auto-launch/issues/81 */}
|
||||
{!IS_MAC && (
|
||||
<SettingsRow
|
||||
@@ -345,15 +310,15 @@ export default function SettingSystem(props: Props) {
|
||||
<SettingAutoLaunch noLabels />
|
||||
</SettingsRow>
|
||||
)}
|
||||
{/* @endif */}
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
<SettingsRow title={__('Leave app running in notification area when the window is closed')}>
|
||||
<SettingClosingBehavior noLabels />
|
||||
</SettingsRow>
|
||||
<SettingsRow
|
||||
title={__('Enable Upgrade to Test Builds')}
|
||||
subtitle={__('Prereleases may break things and we may not be able to fix them for you.')}
|
||||
>
|
||||
<SettingEnablePrereleases />
|
||||
</SettingsRow>
|
||||
{/* @endif */}
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
<SettingsRow
|
||||
title={
|
||||
<span>
|
||||
@@ -414,6 +379,9 @@ export default function SettingSystem(props: Props) {
|
||||
)}
|
||||
</p>
|
||||
</SettingsRow>
|
||||
{/* @endif */}
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
<SettingsRow
|
||||
title={__('Encrypt my wallet with a custom password')}
|
||||
subtitle={
|
||||
@@ -456,6 +424,9 @@ export default function SettingSystem(props: Props) {
|
||||
/>
|
||||
</SettingsRow>
|
||||
)}
|
||||
{/* @endif */}
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
<SettingsRow
|
||||
title={__('Max connections')}
|
||||
subtitle={__(
|
||||
@@ -475,6 +446,7 @@ export default function SettingSystem(props: Props) {
|
||||
)}
|
||||
/>
|
||||
*/}
|
||||
|
||||
<fieldset-section>
|
||||
<FormField
|
||||
name="max_connections"
|
||||
@@ -503,6 +475,8 @@ export default function SettingSystem(props: Props) {
|
||||
<SettingsRow title={__('Share url')} multirow>
|
||||
<SettingShareUrl />
|
||||
</SettingsRow>
|
||||
{/* @endif */}
|
||||
|
||||
<SettingsRow
|
||||
title={__('Clear application cache')}
|
||||
subtitle={__('This might fix issues that you are having. Your wallet will not be affected.')}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, makeSelectTitleForUri } from 'redux/selectors/claims';
|
||||
import SocialShare from './view';
|
||||
import { selectUserInviteReferralCode, selectUser } from 'redux/selectors/user';
|
||||
import { makeSelectContentPositionForUri } from 'redux/selectors/content';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
referralCode: selectUserInviteReferralCode(state),
|
||||
user: selectUser(state),
|
||||
title: makeSelectTitleForUri(props.uri)(state),
|
||||
position: makeSelectContentPositionForUri(props.uri)(state),
|
||||
customShareUrlEnabled: makeSelectClientSetting(SETTINGS.CUSTOM_SHARE_URL_ENABLED)(state),
|
||||
|
||||
@@ -22,6 +22,8 @@ type Props = {
|
||||
claim: StreamClaim,
|
||||
title: ?string,
|
||||
webShareable: boolean,
|
||||
referralCode: string,
|
||||
user: any,
|
||||
position: number,
|
||||
collectionId?: number,
|
||||
customShareUrlEnabled: boolean,
|
||||
@@ -29,7 +31,17 @@ type Props = {
|
||||
};
|
||||
|
||||
function SocialShare(props: Props) {
|
||||
const { claim, title, webShareable, position, collectionId, customShareUrlEnabled, customShareUrl } = props;
|
||||
const {
|
||||
claim,
|
||||
title,
|
||||
referralCode,
|
||||
user,
|
||||
webShareable,
|
||||
position,
|
||||
collectionId,
|
||||
customShareUrlEnabled,
|
||||
customShareUrl,
|
||||
} = props;
|
||||
const [showEmbed, setShowEmbed] = React.useState(false);
|
||||
const [includeCollectionId, setIncludeCollectionId] = React.useState(Boolean(collectionId)); // unless it *is* a collection?
|
||||
const [showClaimLinks, setShowClaimLinks] = React.useState(false);
|
||||
@@ -50,6 +62,7 @@ function SocialShare(props: Props) {
|
||||
const isVideo = isStream && claim.value.stream_type === 'video';
|
||||
const isAudio = isStream && claim.value.stream_type === 'audio';
|
||||
const showStartAt = isVideo || isAudio;
|
||||
const rewardsApproved = user && user.is_reward_approved;
|
||||
const lbryUrl: string = generateLbryContentUrl(canonicalUrl, permanentUrl);
|
||||
const lbryWebUrl: string = generateLbryWebUrl(lbryUrl);
|
||||
const includedCollectionId = collectionId && includeCollectionId ? collectionId : null;
|
||||
@@ -63,8 +76,8 @@ function SocialShare(props: Props) {
|
||||
const shareUrl: string = generateShareUrl(
|
||||
shareDomain,
|
||||
lbryUrl,
|
||||
null,
|
||||
null,
|
||||
referralCode,
|
||||
rewardsApproved,
|
||||
includeStartTime,
|
||||
startTimeSeconds,
|
||||
includedCollectionId
|
||||
@@ -201,6 +214,7 @@ function SocialShare(props: Props) {
|
||||
claim={claim}
|
||||
includeStartTime={includeStartTime}
|
||||
startTime={startTimeSeconds}
|
||||
referralCode={referralCode}
|
||||
/>
|
||||
)}
|
||||
{showClaimLinks && (
|
||||
|
||||
@@ -6,11 +6,18 @@ import classnames from 'classnames';
|
||||
import { useHistory } from 'react-router';
|
||||
import UserEmailNew from 'component/userEmailNew';
|
||||
import UserEmailVerify from 'component/userEmailVerify';
|
||||
import UserFirstChannel from 'component/userFirstChannel';
|
||||
import UserChannelFollowIntro from 'component/userChannelFollowIntro';
|
||||
import UserTagFollowIntro from 'component/userTagFollowIntro';
|
||||
import YoutubeSync from 'page/youtubeSync';
|
||||
import { DEFAULT_BID_FOR_FIRST_CHANNEL } from 'component/userFirstChannel/view';
|
||||
import { YOUTUBE_STATUSES } from 'lbryinc';
|
||||
import REWARDS from 'rewards';
|
||||
import UserVerify from 'component/userVerify';
|
||||
import Spinner from 'component/spinner';
|
||||
import YoutubeTransferStatus from 'component/youtubeTransferStatus';
|
||||
import useFetched from 'effects/use-fetched';
|
||||
import Confetti from 'react-confetti';
|
||||
import usePrevious from 'effects/use-previous';
|
||||
import { SHOW_TAGS_INTRO } from 'config';
|
||||
|
||||
@@ -49,10 +56,12 @@ function UserSignUp(props: Props) {
|
||||
user,
|
||||
claimingReward,
|
||||
claimedRewards,
|
||||
channels,
|
||||
claimConfirmEmailReward,
|
||||
claimNewUserReward,
|
||||
balance,
|
||||
fetchUser,
|
||||
youtubeChannels,
|
||||
syncEnabled,
|
||||
syncingWallet,
|
||||
hasSynced,
|
||||
@@ -76,10 +85,21 @@ function UserSignUp(props: Props) {
|
||||
const shouldRedirectImmediately = urlParams.get(REDIRECT_IMMEDIATELY_PARAM);
|
||||
const [initialSignInStep, setInitialSignInStep] = React.useState();
|
||||
const hasVerifiedEmail = user && user.has_verified_email;
|
||||
const rewardsApproved = user && user.is_reward_approved;
|
||||
const isIdentityVerified = user && user.is_identity_verified;
|
||||
const passwordSet = user && user.password_set;
|
||||
const hasFetchedReward = useFetched(claimingReward);
|
||||
const previousHasVerifiedEmail = usePrevious(hasVerifiedEmail);
|
||||
const channelCount = channels ? channels.length : 0;
|
||||
const hasClaimedEmailAward = claimedRewards.some((reward) => reward.reward_type === REWARDS.TYPE_CONFIRM_EMAIL);
|
||||
const hasYoutubeChannels = youtubeChannels && Boolean(youtubeChannels.length);
|
||||
const isYoutubeTransferComplete =
|
||||
hasYoutubeChannels &&
|
||||
youtubeChannels.every(
|
||||
(channel) =>
|
||||
channel.transfer_state === YOUTUBE_STATUSES.COMPLETED_TRANSFER ||
|
||||
channel.sync_status === YOUTUBE_STATUSES.YOUTUBE_SYNC_ABANDONDED
|
||||
);
|
||||
// Complexity warning
|
||||
// We can't just check if we are currently fetching something
|
||||
// We may want to keep a component rendered while something is being fetched, instead of replacing it with the large spinner
|
||||
@@ -88,6 +108,16 @@ function UserSignUp(props: Props) {
|
||||
// The possible screens for the sign in flow
|
||||
const showEmail = !hasVerifiedEmail;
|
||||
const showEmailVerification = (emailToVerify && !hasVerifiedEmail) || (!hasVerifiedEmail && passwordSet);
|
||||
const showUserVerification = hasVerifiedEmail && !rewardsApproved && !isIdentityVerified && !rewardsAcknowledged;
|
||||
const showChannelCreation =
|
||||
hasVerifiedEmail &&
|
||||
((balance !== undefined &&
|
||||
balance !== null &&
|
||||
balance > DEFAULT_BID_FOR_FIRST_CHANNEL &&
|
||||
channelCount === 0 &&
|
||||
!hasYoutubeChannels) ||
|
||||
interestedInYoutubeSync);
|
||||
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
||||
const showFollowIntro = step === 'channels' || (hasVerifiedEmail && !followingAcknowledged);
|
||||
const showTagsIntro = SHOW_TAGS_INTRO && (step === 'tags' || (hasVerifiedEmail && !tagsAcknowledged));
|
||||
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !showFollowIntro && !showTagsIntro && !rewardsAcknowledged;
|
||||
@@ -140,6 +170,19 @@ function UserSignUp(props: Props) {
|
||||
/>
|
||||
),
|
||||
showEmailVerification && <UserEmailVerify />,
|
||||
showUserVerification && (
|
||||
<UserVerify
|
||||
onSkip={() => {
|
||||
setSettingAndSync(SETTINGS.REWARDS_ACKNOWLEDGED, true);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
showChannelCreation &&
|
||||
(interestedInYoutubeSync ? (
|
||||
<YoutubeSync inSignUpFlow doToggleInterestedInYoutubeSync={doToggleInterestedInYoutubeSync} />
|
||||
) : (
|
||||
<UserFirstChannel doToggleInterestedInYoutubeSync={doToggleInterestedInYoutubeSync} />
|
||||
)),
|
||||
showFollowIntro && (
|
||||
<UserChannelFollowIntro
|
||||
onContinue={() => {
|
||||
@@ -180,6 +223,11 @@ function UserSignUp(props: Props) {
|
||||
}}
|
||||
/>
|
||||
),
|
||||
showYoutubeTransfer && (
|
||||
<div>
|
||||
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
||||
</div>
|
||||
),
|
||||
showLoadingSpinner && (
|
||||
<div className="main--empty">
|
||||
<Spinner />
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
// Created by xander on 6/21/2021
|
||||
import videojs from 'video.js';
|
||||
import 'videojs-contrib-ads';
|
||||
import 'videojs-ima';
|
||||
const VERSION = '0.0.1';
|
||||
|
||||
/* Macro provided by aniview
|
||||
* const macroUrl =
|
||||
`https://vast.aniview.com/api/adserver61/vast/` +
|
||||
`?AV_PUBLISHERID=60afcbc58cfdb065440d2426` +
|
||||
`&AV_CHANNELID=60b354389c7adb506d0bd9a4` +
|
||||
`&AV_URL=[URL_MACRO]` +
|
||||
`&cb=[TIMESTAMP_MACRO]` +
|
||||
`&AV_WIDTH=[WIDTH_MACRO]` +
|
||||
`&AV_HEIGHT=[HEIGHT_MACRO]` +
|
||||
`&AV_SCHAIN=[SCHAIN_MACRO]` +
|
||||
`&AV_CCPA=[CCPA_MACRO]` +
|
||||
`&AV_GDPR=[GDPR_MACRO]` +
|
||||
`&AV_CONSENT=[CONSENT_MACRO]` +
|
||||
`&skip=true` +
|
||||
`&skiptimer=5` +
|
||||
`&logo=false` +
|
||||
`&usevslot=true` +
|
||||
`&vastretry=3` +
|
||||
`&hidecontrols=false`;
|
||||
* */
|
||||
|
||||
// TEST PRE-ROLL WITH THIS TAG:
|
||||
// https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpreonly&cmsid=496&vid=short_onecue&correlator=
|
||||
|
||||
// Modified to work with IMA
|
||||
const macroUrl =
|
||||
`https://vast.aniview.com/api/adserver61/vast/` +
|
||||
`?AV_PUBLISHERID=60afcbc58cfdb065440d2426` +
|
||||
`&AV_CHANNELID=60b354389c7adb506d0bd9a4` +
|
||||
`&AV_URL=[URL]` +
|
||||
`&cb=[CACHEBUSTING]` +
|
||||
`&AV_WIDTH=[WIDTH]` +
|
||||
`&AV_HEIGHT=[HEIGHT]` +
|
||||
// `&AV_SCHAIN=[SCHAIN_MACRO]` +
|
||||
// `&AV_CCPA=[CCPA_MACRO]` +
|
||||
// `&AV_GDPR=[GDPR_MACRO]` +
|
||||
// `&AV_CONSENT=[CONSENT_MACRO]` +
|
||||
`&skip=true` +
|
||||
`&skiptimer=5` +
|
||||
`&logo=true` +
|
||||
`&usevslot=true` +
|
||||
`&vastretry=5` +
|
||||
`&hidecontrols=false`;
|
||||
|
||||
const defaults = {
|
||||
adTagUrl: macroUrl,
|
||||
debug: false,
|
||||
};
|
||||
|
||||
const Component = videojs.getComponent('Component');
|
||||
const registerPlugin = videojs.registerPlugin || videojs.plugin;
|
||||
|
||||
class AniviewPlugin extends Component {
|
||||
constructor(player, options) {
|
||||
super(player, options);
|
||||
|
||||
// Plugin started
|
||||
if (options.debug) this.log(`Created aniview plugin.`);
|
||||
|
||||
// To help with debugging, we'll add a global vjs object with the video js player
|
||||
window.aniview = player;
|
||||
|
||||
this.player = player;
|
||||
|
||||
// request ads whenever there's new video content
|
||||
/* player.on('contentchanged', () => {
|
||||
// in a real plugin, you might fetch your ad inventory here
|
||||
player.trigger('adsready');
|
||||
}); */
|
||||
|
||||
// Plugin event listeners
|
||||
// player.on('readyforpreroll', (event) => this.onReadyForPreroll(event));
|
||||
}
|
||||
|
||||
/* onReadyForPreroll(event) {
|
||||
// send event when ad is playing to remove loading spinner
|
||||
this.player.one('adplaying', () => {
|
||||
this.player.trigger('ads-ad-started');
|
||||
});
|
||||
|
||||
// resume content when all your linear ads have finished
|
||||
this.player.one('adended', () => {
|
||||
this.player.ads.endLinearAdMode();
|
||||
});
|
||||
} */
|
||||
|
||||
log(...args) {
|
||||
if (this.options_.debug) {
|
||||
console.log(`Aniview Debug:`, JSON.stringify(args));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
videojs.registerComponent('aniview', AniviewPlugin);
|
||||
|
||||
const onPlayerReady = (player, options) => {
|
||||
player.aniview = new AniviewPlugin(player, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize the plugin.
|
||||
*
|
||||
* @function plugin
|
||||
* @param {Object} [options={}]
|
||||
*/
|
||||
const plugin = function (options) {
|
||||
const google = window.google;
|
||||
|
||||
this.ima({
|
||||
// $FlowFixMe
|
||||
vpaidMode: google.ima.ImaSdkSettings.VpaidMode.INSECURE,
|
||||
adTagUrl: macroUrl,
|
||||
});
|
||||
|
||||
this.ready(() => {
|
||||
onPlayerReady(this, videojs.mergeOptions(defaults, options));
|
||||
});
|
||||
};
|
||||
|
||||
plugin.VERSION = VERSION;
|
||||
|
||||
registerPlugin('aniview', plugin);
|
||||
|
||||
export default plugin;
|
||||
+22
-1
@@ -34,7 +34,7 @@ class TouchOverlay extends Component {
|
||||
this.addChild('playToggle', {});
|
||||
|
||||
// Clear overlay when playback starts or with control fade
|
||||
player.on(['playing', 'userinactive'], (e) => {
|
||||
player.on(['playing', 'userinactive'], e => {
|
||||
if (!this.player_.paused()) {
|
||||
this.removeClass('show-play-toggle');
|
||||
}
|
||||
@@ -104,6 +104,27 @@ class TouchOverlay extends Component {
|
||||
handleSingleTap(event) {
|
||||
this.removeClass('skip');
|
||||
this.toggleClass('show-play-toggle');
|
||||
|
||||
// At the moment, we only have one <video> tag at a time, but just loops it
|
||||
// all to somewhat future-proof it.
|
||||
const videos = document.getElementsByTagName('video');
|
||||
for (let video of videos) {
|
||||
// The Android-Chrome cast button appears when you tap directly on the
|
||||
// video. If anything exists above it, such as our mobile-ui overlay, the
|
||||
// action will be absorbed, causing the button to not appear. So, I've
|
||||
// tried to pass on the tap event by manually dispatching one, but it
|
||||
// didn't work.
|
||||
// Peeking at the Android-Chrome code, the cast button is refreshed when
|
||||
// the 'controllist' is updated. Since we don't use this attribute as we
|
||||
// are using the videojs controls, I'm "toggling" this attribute to force
|
||||
// the cast button to be refreshed.
|
||||
const attr = video.getAttribute('controlslist');
|
||||
if (!attr || attr.indexOf('dummy') === -1) {
|
||||
video.setAttribute('controlslist', 'dummy');
|
||||
} else {
|
||||
video.removeAttribute('controlslist');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,7 +38,8 @@ export default function YrblHelp(props: Props) {
|
||||
}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
<Button button="secondary" icon={ICONS.BUY} label={'Buy Credits'} navigate={`/$/${PAGES.BUY}`} />
|
||||
<Button button="primary" icon={ICONS.REWARDS} label={__('Earn Rewards')} navigate={`/$/${PAGES.REWARDS}`} />
|
||||
<Button button="secondary" icon={ICONS.BUY} label={'Buy/Swap Credits'} navigate={`/$/${PAGES.BUY}`} />
|
||||
{includeWalletLink && (
|
||||
<Button
|
||||
icon={ICONS.RECEIVE}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -38,4 +38,3 @@ export const USE_UPNP = 'use_upnp';
|
||||
export const WALLET_DIR = 'wallet_dir';
|
||||
export const WALLETS = 'wallets';
|
||||
export const BLOB_STORAGE_LIMIT_MB = 'blob_storage_limit';
|
||||
export const NETWORK_STORAGE_LIMIT_MB = 'network_storage_limit';
|
||||
@@ -19,7 +19,6 @@ export const AFFIRM_PURCHASE = 'affirm_purchase';
|
||||
export const CONFIRM_CLAIM_REVOKE = 'confirm_claim_revoke';
|
||||
export const FIRST_SUBSCRIPTION = 'firstSubscription';
|
||||
export const SEND_TIP = 'send_tip';
|
||||
export const REPOST = 'repost';
|
||||
export const CONFIRM_SEND_TIP = 'confirm_send_tip';
|
||||
export const SOCIAL_SHARE = 'social_share';
|
||||
export const PUBLISH = 'publish';
|
||||
|
||||
@@ -43,7 +43,6 @@ export const CUSTOM_COMMENTS_SERVER_ENABLED = 'custom_comments_server_enabled';
|
||||
export const CUSTOM_COMMENTS_SERVER_URL = 'custom_comments_server_url';
|
||||
export const CUSTOM_SHARE_URL_ENABLED = 'custom_share_url_enabled';
|
||||
export const CUSTOM_SHARE_URL = 'custom_share_url';
|
||||
export const ENABLE_PRERELEASE_UPDATES = 'enable_prerelease_updates';
|
||||
|
||||
export const SETTINGS_GRP = {
|
||||
APPEARANCE: 'appearance',
|
||||
|
||||
@@ -11,7 +11,6 @@ import * as MODALS from 'constants/modal_types';
|
||||
import React, { Fragment, useState, useEffect } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import {
|
||||
doDaemonReady,
|
||||
doAutoUpdate,
|
||||
@@ -34,7 +33,6 @@ import { PersistGate } from 'redux-persist/integration/react';
|
||||
import analytics from 'analytics';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { getAuthToken, setAuthToken, doAuthTokenRefresh } from 'util/saved-passwords';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { DEFAULT_LANGUAGE, LBRY_API_URL } from 'config';
|
||||
|
||||
// Import 3rd-party styles before ours for the current way we are code-splitting.
|
||||
@@ -187,16 +185,6 @@ function AppWrapper() {
|
||||
const [readyToLaunch, setReadyToLaunch] = useState(IS_WEB);
|
||||
const [persistDone, setPersistDone] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (persistDone) {
|
||||
const state = store.getState();
|
||||
const enabled = makeSelectClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES)(state);
|
||||
if (enabled) {
|
||||
autoUpdater.allowPrerelease = true;
|
||||
}
|
||||
}
|
||||
}, [persistDone]);
|
||||
|
||||
useEffect(() => {
|
||||
// @if TARGET='app'
|
||||
moment.locale(remote.app.getLocale());
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import ModalRepost from './view';
|
||||
|
||||
const perform = dispatch => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
});
|
||||
|
||||
export default connect(null, perform)(ModalRepost);
|
||||
@@ -1,32 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { Modal } from 'modal/modal';
|
||||
import RepostCreate from 'component/repostCreate';
|
||||
import Card from 'component/common/card';
|
||||
|
||||
type Props = {
|
||||
closeModal: () => void,
|
||||
uri: string,
|
||||
name: string,
|
||||
contentUri: string,
|
||||
setContentUri: () => void,
|
||||
repostUri: string,
|
||||
setRepostUri: () => void,
|
||||
}
|
||||
|
||||
class ModalRepost extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { closeModal, uri, name, contentUri, setContentUri, repostUri, setRepostUri } = this.props;
|
||||
|
||||
return (
|
||||
<Modal onAborted={closeModal} isOpen type="card">
|
||||
<Card
|
||||
title={__('Repost')}
|
||||
actions={<RepostCreate isModal uri={uri} name={name} onCancel={closeModal} contentUri={contentUri} setContentUri={setContentUri} repostUri={repostUri} setRepostUri={setRepostUri} />}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ModalRepost;
|
||||
@@ -53,7 +53,6 @@ import ModalRemoveFile from 'modal/modalRemoveFile';
|
||||
import ModalRevokeClaim from 'modal/modalRevokeClaim';
|
||||
import ModalRewardCode from 'modal/modalRewardCode';
|
||||
import ModalSendTip from 'modal/modalSendTip';
|
||||
import ModalRepost from 'modal/modalRepost';
|
||||
import ModalSetReferrer from 'modal/modalSetReferrer';
|
||||
import ModalSignOut from 'modal/modalSignOut';
|
||||
import ModalSocialShare from 'modal/modalSocialShare';
|
||||
@@ -125,8 +124,6 @@ function ModalRouter(props: Props) {
|
||||
return ModalFirstSubscription;
|
||||
case MODALS.SEND_TIP:
|
||||
return ModalSendTip;
|
||||
case MODALS.REPOST:
|
||||
return ModalRepost;
|
||||
case MODALS.SOCIAL_SHARE:
|
||||
return ModalSocialShare;
|
||||
case MODALS.PUBLISH:
|
||||
|
||||
+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 LBC')} 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>
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ import ChannelContent from 'component/channelContent';
|
||||
import ChannelAbout from 'component/channelAbout';
|
||||
import ChannelDiscussion from 'component/channelDiscussion';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import ChannelForm from 'component/channelForm';
|
||||
import ChannelEdit from 'component/channelEdit';
|
||||
import classnames from 'classnames';
|
||||
import HelpLink from 'component/common/help-link';
|
||||
import ClaimSupportButton from 'component/claimSupportButton';
|
||||
@@ -202,7 +202,7 @@ function ChannelPage(props: Props) {
|
||||
simpleTitle: __('Editing'),
|
||||
}}
|
||||
>
|
||||
<ChannelForm uri={uri} onDone={() => goBack()} />
|
||||
<ChannelEdit uri={uri} onDone={() => goBack()} />
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
import ChannelForm from 'component/channelForm';
|
||||
import ChannelEdit from 'component/channelEdit';
|
||||
import Page from 'component/page';
|
||||
import { useHistory } from 'react-router';
|
||||
import YrblWalletEmpty from 'component/yrblWalletEmpty';
|
||||
@@ -29,7 +29,7 @@ function ChannelNew(props: Props) {
|
||||
<Page noSideNavigation noFooter backout={{ title: __('Create a channel'), backLabel: __('Cancel') }}>
|
||||
{emptyBalance && <YrblWalletEmpty />}
|
||||
|
||||
<ChannelForm
|
||||
<ChannelEdit
|
||||
disabled={emptyBalance}
|
||||
onDone={() => {
|
||||
push(redirectUrl || `/$/${PAGES.CHANNELS}`);
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
selectUserInviteStatusIsPending,
|
||||
selectUserVerifiedEmail,
|
||||
} from 'redux/selectors/user';
|
||||
// import { doFetchInviteStatus } from 'redux/actions/user';
|
||||
import { doFetchInviteStatus } from 'redux/actions/user';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
import InvitePage from './view';
|
||||
@@ -18,7 +18,7 @@ const select = (state) => ({
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
// fetchInviteStatus: () => dispatch(doFetchInviteStatus()),
|
||||
fetchInviteStatus: () => dispatch(doFetchInviteStatus()),
|
||||
acknowledgeInivte: () => dispatch(doSetClientSetting(SETTINGS.INVITE_ACKNOWLEDGED, true)),
|
||||
});
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { doToast } from 'redux/actions/notifications';
|
||||
import * as ACTIONS from 'constants/action_types';
|
||||
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
|
||||
import { selectUserIsRewardApproved } from 'redux/selectors/user';
|
||||
// import { doFetchInviteStatus } from 'redux/actions/user';
|
||||
import { doFetchInviteStatus } from 'redux/actions/user';
|
||||
import rewards from 'rewards';
|
||||
|
||||
export function doRewardList() {
|
||||
@@ -88,6 +88,8 @@ export function doClaimRewardType(rewardType, options = {}) {
|
||||
});
|
||||
if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) {
|
||||
rewards.callbacks.claimFirstRewardSuccess();
|
||||
} else if (successReward.reward_type === rewards.TYPE_REFERRAL) {
|
||||
dispatch(doFetchInviteStatus());
|
||||
}
|
||||
|
||||
dispatch(doRewardList());
|
||||
@@ -123,6 +125,7 @@ export function doClaimRewardType(rewardType, options = {}) {
|
||||
|
||||
export function doClaimInitialRewards() {
|
||||
return (dispatch) => {
|
||||
dispatch(doClaimRewardType(rewards.TYPE_NEW_USER));
|
||||
dispatch(doClaimRewardType(rewards.TYPE_CONFIRM_EMAIL));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { batchActions } from 'util/batch-actions';
|
||||
import * as ACTIONS from 'constants/action_types';
|
||||
import { doClaimRewardType, doRewardList } from 'redux/actions/rewards';
|
||||
import { selectEmailToVerify, selectPhoneToVerify, selectUserCountryCode, selectUser } from 'redux/selectors/user';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import rewards from 'rewards';
|
||||
import { Lbryio } from 'lbryinc';
|
||||
import { DOMAIN } from 'config';
|
||||
@@ -155,6 +156,7 @@ export function doAuthenticate(
|
||||
|
||||
if (shareUsageData) {
|
||||
dispatch(doRewardList());
|
||||
dispatch(doFetchInviteStatus(false));
|
||||
if (callInstall) {
|
||||
doInstallNew(appVersion, os, firebaseToken, callbackForUsersWhoAreSharingData, domain);
|
||||
}
|
||||
@@ -640,6 +642,37 @@ export function doUserIdentityVerify(stripeToken) {
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserInviteNew(email) {
|
||||
return (dispatch) => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_INVITE_NEW_STARTED,
|
||||
});
|
||||
|
||||
return Lbryio.call('user', 'invite', { email }, 'post')
|
||||
.then((success) => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_INVITE_NEW_SUCCESS,
|
||||
data: { email },
|
||||
});
|
||||
|
||||
dispatch(
|
||||
doToast({
|
||||
message: __('Invite sent to %email_address%', { email_address: email }),
|
||||
})
|
||||
);
|
||||
|
||||
dispatch(doFetchInviteStatus());
|
||||
return success;
|
||||
})
|
||||
.catch((error) => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_INVITE_NEW_FAILURE,
|
||||
data: { error },
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserSetReferrerReset() {
|
||||
return (dispatch) => {
|
||||
dispatch({
|
||||
|
||||
@@ -80,7 +80,6 @@ const defaultState = {
|
||||
// OS
|
||||
[SETTINGS.AUTO_LAUNCH]: true,
|
||||
[SETTINGS.TO_TRAY_WHEN_CLOSED]: true,
|
||||
[SETTINGS.ENABLE_PRERELEASE_UPDATES]: false,
|
||||
},
|
||||
};
|
||||
defaultState.clientSettings[SETTINGS.AUTOPLAY_NEXT] = defaultState.clientSettings[SETTINGS.AUTOPLAY_MEDIA];
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -37,7 +37,7 @@ export const makeSelectDownloadingForUri = (uri) =>
|
||||
return byOutpoint[fileInfo.outpoint];
|
||||
});
|
||||
|
||||
export const selectUrisLoading = createSelector(selectState, (state) => state.fetching || {});
|
||||
export const selectUrisLoading = createSelector(selectState, (state) => state.urisLoading || {});
|
||||
|
||||
export const makeSelectLoadingForUri = (uri) =>
|
||||
createSelector(selectUrisLoading, makeSelectClaimForUri(uri), (fetchingByOutpoint, claim) => {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
top: var(--spacing-s);
|
||||
}
|
||||
|
||||
.content__viewer--disable-click {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.content__viewer--inline {
|
||||
max-height: var(--inline-player-max-height);
|
||||
border: none;
|
||||
|
||||
@@ -474,6 +474,42 @@
|
||||
&.skip {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
// Override the original's 'display: block' to avoid the big play button
|
||||
// from being squished to the side:
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
video::-internal-media-controls-overlay-cast-button {
|
||||
// Push the cast button above vjs-touch-overlay:
|
||||
z-index: 3;
|
||||
|
||||
// Move it to the upper-right since it will clash with "tap to unmute":
|
||||
left: unset;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
.video-js.video-js.vjs-user-inactive {
|
||||
video::-internal-media-controls-overlay-cast-button {
|
||||
// (1) Android-Chrome's original Cast button behavior:
|
||||
// - If video is playing, fade out the button.
|
||||
// - If video is paused and video is tapped, display the button and stay on.
|
||||
// (2) We then injected another behavior:
|
||||
// - Display the button when '.vjs-touch-overlay' is displayed. However,
|
||||
// the 'controlslist' attribute hack that was used to do this results in the
|
||||
// button staying displayed without a fade-out timer.
|
||||
// (3) Ideally, we should sync the '.vjs-touch-overlay' visibility with the
|
||||
// cast button, similar to how to controlBar's visibility is synced above.
|
||||
// But I have no idea how to grab the sibling '.show-play-toggle' into the
|
||||
// css logic.
|
||||
// (4) So, this is the best that I can come up with: Whenever user is idle,
|
||||
// the button goes away. The only downside I know is the scenario of
|
||||
// "overlay is up and video is paused, but button goes away due to idle".
|
||||
// The user just needs to re-tap any empty space on the overlay to get the
|
||||
// Cast button again.
|
||||
opacity: 0;
|
||||
transition: opacity 1s ease;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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'],
|
||||
},
|
||||
|
||||
+19
-19
@@ -42,25 +42,25 @@ let mainConfig = {
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: `${STATIC_ROOT}/`,
|
||||
to: `${DIST_ROOT}/electron/static/`,
|
||||
globOptions: {
|
||||
ignore: ['index-web.html', 'index-electron.html', 'daemon/**/*'],
|
||||
},
|
||||
},
|
||||
{
|
||||
from: `${STATIC_ROOT}/index-electron.html`,
|
||||
to: `${DIST_ROOT}/electron/static/index.html`,
|
||||
},
|
||||
{
|
||||
from: `${STATIC_ROOT}/daemon`,
|
||||
to: `${DIST_ROOT}/electron/daemon`,
|
||||
},
|
||||
],
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: `${STATIC_ROOT}/`,
|
||||
to: `${DIST_ROOT}/electron/static/`,
|
||||
ignore: ['index-web.html', 'index-electron.html', 'daemon/**/*', 'lbry-first/**/*'],
|
||||
},
|
||||
{
|
||||
from: `${STATIC_ROOT}/index-electron.html`,
|
||||
to: `${DIST_ROOT}/electron/static/index.html`,
|
||||
},
|
||||
{
|
||||
from: `${STATIC_ROOT}/daemon`,
|
||||
to: `${DIST_ROOT}/electron/daemon`,
|
||||
},
|
||||
{
|
||||
from: `${STATIC_ROOT}/lbry-first`,
|
||||
to: `${DIST_ROOT}/electron/lbry-first`,
|
||||
},
|
||||
]),
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user