fix: publish bugs

Fixes files being passed on edit + tags not repopulating.
This commit is contained in:
Thomas Zarebczan 2019-08-14 14:47:57 -04:00
parent adbbd7e660
commit 1a3615cddb
2 changed files with 6 additions and 20 deletions

15
dist/bundle.es.js vendored
View file

@ -3044,7 +3044,8 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
license, license,
license_url: licenseUrl, license_url: licenseUrl,
thumbnail, thumbnail,
title title,
tags
} = value; } = value;
const publishData = { const publishData = {
@ -3060,7 +3061,8 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
uri, uri,
uploadThumbnailStatus: thumbnail ? MANUAL : undefined, uploadThumbnailStatus: thumbnail ? MANUAL : undefined,
licenseUrl, licenseUrl,
nsfw: isClaimNsfw(claim) nsfw: isClaimNsfw(claim),
tags: tags ? tags.map(tag => ({ name: tag })) : []
}; };
// Make sure custom licenses are mapped properly // Make sure custom licenses are mapped properly
@ -3082,15 +3084,6 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
publishData['channel'] = channelName; 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 }); 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, license_url: licenseUrl,
thumbnail, thumbnail,
title, title,
tags,
} = value; } = value;
const publishData: UpdatePublishFormData = { const publishData: UpdatePublishFormData = {
@ -205,6 +206,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
uploadThumbnailStatus: thumbnail ? THUMBNAIL_STATUSES.MANUAL : undefined, uploadThumbnailStatus: thumbnail ? THUMBNAIL_STATUSES.MANUAL : undefined,
licenseUrl, licenseUrl,
nsfw: isClaimNsfw(claim), nsfw: isClaimNsfw(claim),
tags: tags ? tags.map(tag => ({ name: tag })) : [],
}; };
// Make sure custom licenses are mapped properly // Make sure custom licenses are mapped properly
@ -226,15 +228,6 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
publishData['channel'] = channelName; 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 }); dispatch({ type: ACTIONS.DO_PREPARE_EDIT, data: publishData });
}; };