fix: prefil publish links and required lbry-redux publish changes
This commit is contained in:
parent
58a31d5cd3
commit
fa09f8a860
8 changed files with 29 additions and 9 deletions
|
@ -125,7 +125,7 @@
|
|||
"jsmediatags": "^3.8.1",
|
||||
"json-loader": "^0.5.4",
|
||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||
"lbry-redux": "lbryio/lbry-redux#05e70648e05c51c51710f6dd698a8e2219b54df2",
|
||||
"lbry-redux": "lbryio/lbry-redux#58bbdb9a2e537b3994d545ede120d070a7b41ee5",
|
||||
"lbryinc": "lbryio/lbryinc#a93596c51c8fb0a226cb84df04c26a6bb60a45fb",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import * as PAGES from 'constants/pages';
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doResolveUri,
|
||||
|
@ -10,11 +11,15 @@ import {
|
|||
makeSelectClaimIsNsfw,
|
||||
selectBlockedChannels,
|
||||
selectChannelIsBlocked,
|
||||
doClearPublish,
|
||||
doPrepareEdit,
|
||||
} from 'lbry-redux';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { makeSelectHasVisitedUri } from 'redux/selectors/content';
|
||||
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
||||
import { push } from 'connected-react-router';
|
||||
|
||||
import ClaimPreview from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
@ -36,6 +41,11 @@ const select = (state, props) => ({
|
|||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
beginPublish: name => {
|
||||
dispatch(doClearPublish());
|
||||
dispatch(doPrepareEdit({ name }));
|
||||
dispatch(push(`/$/${PAGES.PUBLISH}`));
|
||||
},
|
||||
});
|
||||
|
||||
export default connect(
|
||||
|
|
|
@ -44,6 +44,7 @@ type Props = {
|
|||
blockedChannelUris: Array<string>,
|
||||
channelIsBlocked: boolean,
|
||||
isSubscribed: boolean,
|
||||
beginPublish: string => void,
|
||||
};
|
||||
|
||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
|
@ -68,6 +69,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
|||
showUserBlocked,
|
||||
channelIsBlocked,
|
||||
isSubscribed,
|
||||
beginPublish,
|
||||
} = props;
|
||||
const haventFetched = claim === undefined;
|
||||
const abandoned = !isResolvingUri && !claim;
|
||||
|
@ -77,8 +79,9 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
|||
const hideActions = type === 'small' || type === 'tooltip';
|
||||
|
||||
let isValid;
|
||||
let name;
|
||||
try {
|
||||
parseURI(uri);
|
||||
({ claimName: name } = parseURI(uri));
|
||||
isValid = true;
|
||||
} catch (e) {
|
||||
isValid = false;
|
||||
|
@ -191,7 +194,11 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
|||
<Fragment>
|
||||
<div>{__('Publish something and claim this spot!')}</div>
|
||||
<div className="card__actions">
|
||||
<Button button="primary" label={`${__('Publish to')} ${uri}`} />
|
||||
<Button
|
||||
onClick={() => beginPublish(name)}
|
||||
button="primary"
|
||||
label={`${__('Publish to')} ${uri}`}
|
||||
/>
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
|
|
|
@ -87,7 +87,7 @@ export default function FileViewer(props: Props) {
|
|||
|
||||
const hidePlayer = !isPlaying || !uri || (!inline && (!floatingPlayerEnabled || !isStreamable));
|
||||
if (hidePlayer) {
|
||||
clearPlayingUri();
|
||||
// clearPlayingUri();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { doToast, doUploadThumbnail } from 'lbry-redux';
|
||||
import fs from 'fs';
|
||||
import ModalAutoGenerateThumbnail from './view';
|
||||
|
||||
const perform = dispatch => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
upload: buffer => dispatch(doUploadThumbnail(null, buffer)),
|
||||
upload: buffer => dispatch(doUploadThumbnail(null, buffer, null, fs)),
|
||||
showToast: options => dispatch(doToast(options)),
|
||||
});
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { doUploadThumbnail, doUpdatePublishForm } from 'lbry-redux';
|
||||
import fs from 'fs';
|
||||
import ModalConfirmThumbnailUpload from './view';
|
||||
|
||||
const perform = dispatch => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
upload: path => dispatch(doUploadThumbnail(path)),
|
||||
upload: path => dispatch(doUploadThumbnail(path, null, null, fs)),
|
||||
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
||||
});
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import { doFetchViewCount, makeSelectViewCountForUri, makeSelectCostInfoForUri,
|
|||
import { selectShowMatureContent, makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import fs from 'fs';
|
||||
import FilePage from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
@ -47,7 +48,7 @@ const perform = dispatch => ({
|
|||
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
||||
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
prepareEdit: (publishData, uri, fileInfo) => dispatch(doPrepareEdit(publishData, uri, fileInfo)),
|
||||
prepareEdit: (publishData, uri, fileInfo) => dispatch(doPrepareEdit(publishData, uri, fileInfo, fs)),
|
||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||
setViewed: uri => dispatch(doSetContentHistoryItem(uri)),
|
||||
markSubscriptionRead: (channel, uri) => dispatch(doRemoveUnreadSubscription(channel, uri)),
|
||||
|
|
|
@ -6762,9 +6762,9 @@ lazy-val@^1.0.3, lazy-val@^1.0.4:
|
|||
yargs "^13.2.2"
|
||||
zstd-codec "^0.1.1"
|
||||
|
||||
lbry-redux@lbryio/lbry-redux#05e70648e05c51c51710f6dd698a8e2219b54df2:
|
||||
lbry-redux@lbryio/lbry-redux#58bbdb9a2e537b3994d545ede120d070a7b41ee5:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/05e70648e05c51c51710f6dd698a8e2219b54df2"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/58bbdb9a2e537b3994d545ede120d070a7b41ee5"
|
||||
dependencies:
|
||||
mime "^2.4.4"
|
||||
proxy-polyfill "0.1.6"
|
||||
|
|
Loading…
Reference in a new issue