show edits as pending
This commit is contained in:
parent
3ebeb47fb0
commit
539ca36637
4 changed files with 6 additions and 9 deletions
|
@ -43,9 +43,9 @@ class FileCard extends React.PureComponent<Props> {
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve = (props: 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);
|
resolveUri(uri);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -231,7 +231,7 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
|
||||||
const success = () => {
|
const success = () => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.PUBLISH_SUCCESS,
|
type: ACTIONS.PUBLISH_SUCCESS,
|
||||||
data: { pendingPublish: { ...publishPayload, isEdit: isStillEditing } },
|
data: { pendingPublish: { ...publishPayload } },
|
||||||
});
|
});
|
||||||
dispatch(doNotify({ id: MODALS.PUBLISH }, { uri }));
|
dispatch(doNotify({ id: MODALS.PUBLISH }, { uri }));
|
||||||
};
|
};
|
||||||
|
|
|
@ -147,12 +147,9 @@ export default handleActions(
|
||||||
[ACTIONS.PUBLISH_SUCCESS]: (state: PublishState, action): PublishState => {
|
[ACTIONS.PUBLISH_SUCCESS]: (state: PublishState, action): PublishState => {
|
||||||
const { pendingPublish } = action.data;
|
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();
|
const newPendingPublishes = state.pendingPublishes.slice();
|
||||||
if (!pendingPublish.isEdit) {
|
|
||||||
newPendingPublishes.push(pendingPublish);
|
newPendingPublishes.push(pendingPublish);
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
|
|
@ -40,7 +40,7 @@ export const selectPendingPublish = uri =>
|
||||||
}
|
}
|
||||||
|
|
||||||
return pendingPublishes.filter(
|
return pendingPublishes.filter(
|
||||||
publish => (publish.name === claimName || publish.name === contentName) && !publish.isEdit
|
publish => publish.name === claimName || publish.name === contentName
|
||||||
)[0];
|
)[0];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue