diff --git a/package.json b/package.json index da545c329..c44866807 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "imagesloaded": "^4.1.4", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#1e27a854d012ef758c04b234fb80e74e264d5962", + "lbry-redux": "lbryio/lbry-redux#3be6fa52ac1cb6224cf9de45623183e62c2b24ab", "lbryinc": "lbryio/lbryinc#cc62a4eec10845cc0b31da7d0f27287cfa7c4866", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/static/app-strings.json b/static/app-strings.json index 8332d40d9..0fa2dd516 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1200,5 +1200,7 @@ "this channel": "this channel", "Share this channel": "Share this channel", "File preview": "File preview", - "Go Home": "Go Home" + "Go Home": "Go Home", + "Uploading (%progress%%) ": "Uploading (%progress%%) ", + "Confirming": "Confirming" } diff --git a/ui/component/claimPreview/index.js b/ui/component/claimPreview/index.js index 873a105d5..f2eefe804 100644 --- a/ui/component/claimPreview/index.js +++ b/ui/component/claimPreview/index.js @@ -11,6 +11,7 @@ import { selectBlockedChannels, selectChannelIsBlocked, doFileGet, + makeSelectReflectingClaimForUri, } from 'lbry-redux'; import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc'; import { selectShowMatureContent } from 'redux/selectors/settings'; @@ -21,6 +22,7 @@ import ClaimPreview from './view'; const select = (state, props) => ({ pending: props.uri && makeSelectClaimIsPending(props.uri)(state), claim: props.uri && makeSelectClaimForUri(props.uri)(state), + reflectingInfo: props.uri && makeSelectReflectingClaimForUri(props.uri)(state), obscureNsfw: !selectShowMatureContent(state), claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state), isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state), diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index 14755c4db..0394d6eff 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -21,6 +21,7 @@ import ClaimPreviewSubtitle from 'component/claimPreviewSubtitle'; import ClaimRepostAuthor from 'component/claimRepostAuthor'; import FileDownloadLink from 'component/fileDownloadLink'; import AbandonedChannelPreview from 'component/abandonedChannelPreview'; +import PublishPending from 'component/publishPending'; type Props = { uri: string, @@ -29,6 +30,7 @@ type Props = { showUserBlocked: boolean, claimIsMine: boolean, pending?: boolean, + reflectingInfo?: any, // fxme resolveUri: string => void, isResolvingUri: boolean, history: { push: string => void }, @@ -65,6 +67,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { obscureNsfw, claimIsMine, pending, + reflectingInfo, history, uri, isResolvingUri, @@ -97,7 +100,6 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { const showPublishLink = abandoned && !showUnresolvedClaim && placeholder === 'publish'; const hideActions = type === 'small' || type === 'tooltip'; const canonicalUrl = claim && claim.canonical_url; - let isValid = false; if (uri) { try { @@ -245,28 +247,40 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { ) : ( - - - {/* @if TARGET='app' */} - {claim && ( -
- -
- )} - {/* @endif */} -
-
+ <> + {!pending ? ( + + + {/* @if TARGET='app' */} + {claim && ( +
+ +
+ )} + {/* @endif */} +
+
+ ) : ( + + )} + )}
- + {pending ? ( - + ) : ( + + + + )} + {!isChannel && }
+ {(pending || !!reflectingInfo) && }
{type !== 'small' && (
diff --git a/ui/component/claimPreviewSubtitle/view.jsx b/ui/component/claimPreviewSubtitle/view.jsx index 2977d4cb5..131b33eb0 100644 --- a/ui/component/claimPreviewSubtitle/view.jsx +++ b/ui/component/claimPreviewSubtitle/view.jsx @@ -28,14 +28,9 @@ function ClaimPreviewSubtitle(props: Props) { {claim ? ( {' '} - {pending - ? __('Pending...') - : claim && - (isChannel ? ( - type !== 'inline' && `${claimsInChannel} ${__('publishes')}` - ) : ( - - ))} + {!pending && + claim && + (isChannel ? type !== 'inline' && `${claimsInChannel} ${__('publishes')}` : )} ) : ( diff --git a/ui/component/publishPending/index.js b/ui/component/publishPending/index.js new file mode 100644 index 000000000..efa28236e --- /dev/null +++ b/ui/component/publishPending/index.js @@ -0,0 +1,13 @@ +import { connect } from 'react-redux'; +import { makeSelectReflectingClaimForUri, doCheckReflectingFiles } from 'lbry-redux'; +import PublishPending from './view'; + +const select = (state, props) => ({ + reflectingInfo: props.uri && makeSelectReflectingClaimForUri(props.uri)(state), +}); + +const perform = dispatch => ({ + checkReflecting: () => dispatch(doCheckReflectingFiles()), +}); + +export default connect(select, perform)(PublishPending); diff --git a/ui/component/publishPending/view.jsx b/ui/component/publishPending/view.jsx new file mode 100644 index 000000000..bd0b4029c --- /dev/null +++ b/ui/component/publishPending/view.jsx @@ -0,0 +1,32 @@ +// @flow + +import React from 'react'; +import Lbry from 'lbry-redux'; +import Button from 'component/button'; + +type Props = { + reflectingInfo?: ReflectingUpdate, + checkReflecting: () => void, +}; + +const PublishPending = (props: Props) => { + const { reflectingInfo = {}, checkReflecting } = props; + const { fileListItem, progress, stalled } = reflectingInfo; + const sdHash = fileListItem && fileListItem.sd_hash; + const reflecting = Object.keys(reflectingInfo).length; + if (stalled) { + return ( +