remove edits from pending publishes and update modal style
This commit is contained in:
parent
cde7d97fd4
commit
ca4a51c4b9
5 changed files with 16 additions and 12 deletions
|
@ -1,13 +1,13 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { selectMyClaimsWithoutChannels } from 'lbry-redux';
|
||||
import { selectPendingPublishesLessEdits } from 'redux/selectors/publish';
|
||||
import { selectPendingPublishes } from 'redux/selectors/publish';
|
||||
import { doNavigate } from 'redux/actions/navigation';
|
||||
import { doCheckPendingPublishes } from 'redux/actions/publish';
|
||||
import FileListPublished from './view';
|
||||
|
||||
const select = state => ({
|
||||
claims: selectMyClaimsWithoutChannels(state),
|
||||
pendingPublishes: selectPendingPublishesLessEdits(state),
|
||||
pendingPublishes: selectPendingPublishes(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
|
|
@ -150,7 +150,7 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
|
|||
|
||||
const failure = error => {
|
||||
dispatch({ type: ACTIONS.PUBLISH_FAIL });
|
||||
dispatch(doNotify({ id: MODALS.ERROR }, { error: error.message }));
|
||||
dispatch(doNotify({ id: MODALS.ERROR, error: error.message }));
|
||||
};
|
||||
|
||||
return Lbry.publish(publishPayload).then(success, failure);
|
||||
|
|
|
@ -136,8 +136,12 @@ export default handleActions(
|
|||
[ACTIONS.PUBLISH_SUCCESS]: (state: PublishState, action): PublishState => {
|
||||
const { pendingPublish } = action.data;
|
||||
|
||||
// If it's an edit, don't create a pending publish
|
||||
// It will take some more work to know when an edit is confirmed
|
||||
const newPendingPublishes = state.pendingPublishes.slice();
|
||||
newPendingPublishes.push(pendingPublish);
|
||||
if (pendingPublish.isEdit) {
|
||||
newPendingPublishes.push(pendingPublish);
|
||||
}
|
||||
|
||||
return {
|
||||
...state,
|
||||
|
|
|
@ -8,11 +8,6 @@ export const selectPendingPublishes = createSelector(
|
|||
state => state.pendingPublishes.map(pendingClaim => ({ ...pendingClaim, pending: true })) || []
|
||||
);
|
||||
|
||||
export const selectPendingPublishesLessEdits = createSelector(
|
||||
selectPendingPublishes,
|
||||
pendingPublishes => pendingPublishes.filter(pendingPublish => !pendingPublish.isEdit)
|
||||
);
|
||||
|
||||
export const selectPublishFormValues = createSelector(selectState, state => {
|
||||
const { pendingPublish, ...formValues } = state;
|
||||
return formValues;
|
||||
|
@ -27,6 +22,6 @@ export const selectPendingPublish = uri =>
|
|||
}
|
||||
|
||||
return pendingPublishes.filter(
|
||||
publish => publish.name === claimName || publish.name === contentName
|
||||
publish => (publish.name === claimName || publish.name === contentName) && !publish.isEdit
|
||||
)[0];
|
||||
});
|
||||
|
|
|
@ -86,7 +86,12 @@
|
|||
}
|
||||
|
||||
.modal__button {
|
||||
margin: 0px 6px;
|
||||
margin: 0px $spacing-vertical * 1/3;
|
||||
|
||||
&.btn--link {
|
||||
// So the text isn't bigger than the text inside the button
|
||||
font-size: 0.8em;
|
||||
}
|
||||
}
|
||||
|
||||
.error-modal-overlay {
|
||||
|
@ -119,7 +124,7 @@
|
|||
list-style: none;
|
||||
max-height: 400px;
|
||||
max-width: var(--modal-width);
|
||||
overflow-y: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.error-modal__content p {
|
||||
|
|
Loading…
Add table
Reference in a new issue