Merge pull request #181 from lbryio/fix-publish-bugs

Fix: publish bugs while editing
This commit is contained in:
Sean Yesmunt 2019-08-14 22:25:29 -04:00 committed by GitHub
commit 436e49f859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 20 deletions

15
dist/bundle.es.js vendored
View file

@ -3041,7 +3041,8 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
license,
license_url: licenseUrl,
thumbnail,
title
title,
tags
} = value;
const publishData = {
@ -3057,7 +3058,8 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
uri,
uploadThumbnailStatus: thumbnail ? MANUAL : undefined,
licenseUrl,
nsfw: isClaimNsfw(claim)
nsfw: isClaimNsfw(claim),
tags: tags ? tags.map(tag => ({ name: tag })) : []
};
// Make sure custom licenses are mapped properly
@ -3079,15 +3081,6 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
publishData['channel'] = channelName;
}
if (fs && fileInfo && fileInfo.download_path) {
try {
fs.accessSync(fileInfo.download_path, fs.constants.R_OK);
publishData.filePath = fileInfo.download_path;
} catch (e) {
console.error(e.name, e.message);
}
}
dispatch({ type: DO_PREPARE_EDIT, data: publishData });
};

View file

@ -189,6 +189,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
license_url: licenseUrl,
thumbnail,
title,
tags,
} = value;
const publishData: UpdatePublishFormData = {
@ -205,6 +206,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
uploadThumbnailStatus: thumbnail ? THUMBNAIL_STATUSES.MANUAL : undefined,
licenseUrl,
nsfw: isClaimNsfw(claim),
tags: tags ? tags.map(tag => ({ name: tag })) : [],
};
// Make sure custom licenses are mapped properly
@ -226,15 +228,6 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
publishData['channel'] = channelName;
}
if (fs && fileInfo && fileInfo.download_path) {
try {
fs.accessSync(fileInfo.download_path, fs.constants.R_OK);
publishData.filePath = fileInfo.download_path;
} catch (e) {
console.error(e.name, e.message);
}
}
dispatch({ type: ACTIONS.DO_PREPARE_EDIT, data: publishData });
};