Pending edit magic #1654
4 changed files with 6 additions and 9 deletions
|
@ -43,9 +43,9 @@ class FileCard extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
resolve = (props: Props) => {
|
||||
const { isResolvingUri, resolveUri, claim, uri } = props;
|
||||
const { isResolvingUri, resolveUri, claim, uri, pending } = props;
|
||||
|
||||
if (!isResolvingUri && claim === undefined && uri) {
|
||||
if (!pending && !isResolvingUri && claim === undefined && uri) {
|
||||
resolveUri(uri);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -231,7 +231,7 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
|
|||
const success = () => {
|
||||
dispatch({
|
||||
type: ACTIONS.PUBLISH_SUCCESS,
|
||||
data: { pendingPublish: { ...publishPayload, isEdit: isStillEditing } },
|
||||
data: { pendingPublish: { ...publishPayload } },
|
||||
});
|
||||
dispatch(doNotify({ id: MODALS.PUBLISH }, { uri }));
|
||||
};
|
||||
|
|
|
@ -147,12 +147,9 @@ 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();
|
||||
if (!pendingPublish.isEdit) {
|
||||
newPendingPublishes.push(pendingPublish);
|
||||
}
|
||||
|
||||
newPendingPublishes.push(pendingPublish);
|
||||
|
||||
return {
|
||||
...state,
|
||||
|
|
|
@ -40,7 +40,7 @@ export const selectPendingPublish = uri =>
|
|||
}
|
||||
|
||||
return pendingPublishes.filter(
|
||||
publish => (publish.name === claimName || publish.name === contentName) && !publish.isEdit
|
||||
publish => publish.name === claimName || publish.name === contentName
|
||||
)[0];
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue