resolve merge conflict
This commit is contained in:
commit
28008a3463
5 changed files with 169 additions and 144 deletions
251
dist/bundle.es.js
vendored
251
dist/bundle.es.js
vendored
File diff suppressed because one or more lines are too long
|
@ -510,4 +510,5 @@ export const DEFAULT_KNOWN_TAGS = [
|
|||
'portugal',
|
||||
'dantdm',
|
||||
'teaser',
|
||||
'lbry',
|
||||
];
|
||||
|
|
|
@ -265,6 +265,8 @@ export const doPublish = (success: Function, fail: Function) => (
|
|||
tags,
|
||||
locations,
|
||||
} = publishData;
|
||||
// Handle scenario where we have a claim that has the same name as a channel we are publishing with.
|
||||
const myClaimForUriEditing = myClaimForUri && myClaimForUri.name === name ? myClaimForUri : null;
|
||||
|
||||
let publishingLicense;
|
||||
switch (licenseType) {
|
||||
|
@ -327,10 +329,10 @@ export const doPublish = (success: Function, fail: Function) => (
|
|||
}
|
||||
|
||||
// Set release time to curret date. On edits, keep original release/transaction time as release_time
|
||||
if (myClaimForUri && myClaimForUri.value.release_time) {
|
||||
if (myClaimForUriEditing && myClaimForUriEditing.value.release_time) {
|
||||
publishPayload.release_time = Number(myClaimForUri.value.release_time);
|
||||
} else if (myClaimForUri && myClaimForUri.timestamp) {
|
||||
publishPayload.release_time = Number(myClaimForUri.timestamp);
|
||||
} else if (myClaimForUriEditing && myClaimForUriEditing.timestamp) {
|
||||
publishPayload.release_time = Number(myClaimForUriEditing.timestamp);
|
||||
} else {
|
||||
publishPayload.release_time = Number(Math.round(Date.now() / 1000));
|
||||
}
|
||||
|
@ -339,8 +341,8 @@ export const doPublish = (success: Function, fail: Function) => (
|
|||
publishPayload.channel_id = channelId;
|
||||
}
|
||||
|
||||
if (myClaimForUri && myClaimForUri.value && myClaimForUri.value.locations) {
|
||||
publishPayload.locations = myClaimForUri.value.locations;
|
||||
if (myClaimForUriEditing && myClaimForUriEditing.value && myClaimForUriEditing.value.locations) {
|
||||
publishPayload.locations = myClaimForUriEditing.value.locations;
|
||||
}
|
||||
|
||||
if (!contentIsFree && fee && (fee.currency && Number(fee.amount) > 0)) {
|
||||
|
|
|
@ -43,7 +43,7 @@ const defaultState: PublishState = {
|
|||
thumbnailPath: '',
|
||||
uploadThumbnailStatus: THUMBNAIL_STATUSES.API_DOWN,
|
||||
description: '',
|
||||
language: 'en',
|
||||
language: '',
|
||||
nsfw: false,
|
||||
channel: CHANNEL_ANONYMOUS,
|
||||
channelId: '',
|
||||
|
|
|
@ -9,23 +9,9 @@ import {
|
|||
|
||||
const selectState = state => state.publish || {};
|
||||
|
||||
export const selectPublishFormValues = createSelector(
|
||||
selectState,
|
||||
state => {
|
||||
const { pendingPublish, ...formValues } = state;
|
||||
return formValues;
|
||||
}
|
||||
);
|
||||
|
||||
export const makeSelectPublishFormValue = item =>
|
||||
createSelector(
|
||||
selectState,
|
||||
state => state[item]
|
||||
);
|
||||
|
||||
// Is the current uri the same as the uri they clicked "edit" on
|
||||
export const selectIsStillEditing = createSelector(
|
||||
selectPublishFormValues,
|
||||
selectState,
|
||||
publishState => {
|
||||
const { editingURI, uri } = publishState;
|
||||
|
||||
|
@ -52,6 +38,29 @@ export const selectIsStillEditing = createSelector(
|
|||
}
|
||||
);
|
||||
|
||||
export const selectPublishFormValues = createSelector(
|
||||
selectState,
|
||||
selectIsStillEditing,
|
||||
(state, isStillEditing) => {
|
||||
const { pendingPublish, language, languages, ...formValues } = state;
|
||||
|
||||
let actualLanguage;
|
||||
// Sets default if editing a claim with a set language
|
||||
if (!language && isStillEditing && languages && languages[0]) {
|
||||
actualLanguage = languages[0];
|
||||
} else {
|
||||
actualLanguage = language || 'en';
|
||||
}
|
||||
return { ...formValues, language: actualLanguage };
|
||||
}
|
||||
);
|
||||
|
||||
export const makeSelectPublishFormValue = item =>
|
||||
createSelector(
|
||||
selectState,
|
||||
state => state[item]
|
||||
);
|
||||
|
||||
export const selectMyClaimForUri = createSelector(
|
||||
selectPublishFormValues,
|
||||
selectIsStillEditing,
|
||||
|
@ -68,10 +77,10 @@ export const selectMyClaimForUri = createSelector(
|
|||
return isStillEditing
|
||||
? claimsById[editClaimId]
|
||||
: myClaims.find(claim =>
|
||||
!contentName
|
||||
? claim.name === claimName
|
||||
: claim.name === contentName || claim.name === claimName
|
||||
);
|
||||
!contentName
|
||||
? claim.name === claimName
|
||||
: claim.name === contentName || claim.name === claimName
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue