Random fixes #2729

Merged
neb-b merged 12 commits from fixes into master 2019-08-15 05:11:48 +02:00
8 changed files with 29 additions and 9 deletions
Showing only changes of commit fa09f8a860 - Show all commits

View file

@ -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",

View file

@ -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(

View file

@ -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>
)}

View file

@ -87,7 +87,7 @@ export default function FileViewer(props: Props) {
const hidePlayer = !isPlaying || !uri || (!inline && (!floatingPlayerEnabled || !isStreamable));
if (hidePlayer) {
clearPlayingUri();
// clearPlayingUri();
return null;
}

View file

@ -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)),
kauffj commented 2019-08-15 00:29:01 +02:00 (Migrated from github.com)
Review

should these 3rd and 4th params be re-ordered? (meh)

should these 3rd and 4th params be re-ordered? (meh)
neb-b commented 2019-08-15 04:57:51 +02:00 (Migrated from github.com)
Review

The third param is the android equivalent of fs

The third param is the android equivalent of `fs`
});

View file

@ -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)),
kauffj commented 2019-08-15 00:29:31 +02:00 (Migrated from github.com)
Review

same question as above, if fs is regularly provided but other params are not, consider moving fs up in param order

when does JS get named parameters?!

same question as above, if `fs` is regularly provided but other params are not, consider moving fs up in param order when does JS get named parameters?!
});

View file

@ -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)),

View file

@ -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"