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_url: licenseUrl,
thumbnail,
title
title,
tags
} = value;
const publishData = {
@ -3060,7 +3061,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
@ -3082,15 +3084,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 });
};