fix license type on edit

This commit is contained in:
Sean Yesmunt 2018-11-07 23:14:35 -05:00
parent 2c9c174ed8
commit 523fdf694b

View file

@ -22,7 +22,7 @@ import { selectosNotificationsEnabled } from 'redux/selectors/settings';
import { doNavigate } from 'redux/actions/navigation'; import { doNavigate } from 'redux/actions/navigation';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import { CC_LICENSES, COPYRIGHT, OTHER } from 'constants/licenses'; import { CC_LICENSES, COPYRIGHT, OTHER, NONE, PUBLIC_DOMAIN } from 'constants/licenses';
type Action = UpdatePublishFormAction | { type: ACTIONS.CLEAR_PUBLISH }; type Action = UpdatePublishFormAction | { type: ACTIONS.CLEAR_PUBLISH };
@ -179,8 +179,11 @@ export const doPrepareEdit = (claim: any, uri: string) => (dispatch: Dispatch<Ac
}; };
// Make sure custom liscence's are mapped properly // Make sure custom liscence's are mapped properly
// If the license isn't one of the standard licenses, map the custom license and description/url
if (!CC_LICENSES.some(({ value }) => value === license)) { if (!CC_LICENSES.some(({ value }) => value === license)) {
if (!licenseUrl) { if (!license || license === NONE || license === PUBLIC_DOMAIN) {
publishData.licenseType = license;
} else if (license && !licenseUrl && license !== NONE) {
publishData.licenseType = COPYRIGHT; publishData.licenseType = COPYRIGHT;
} else { } else {
publishData.licenseType = OTHER; publishData.licenseType = OTHER;