From 539ca36637f7f452fb18100cafad457c4c6307a6 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 20 Jun 2018 15:30:52 -0400 Subject: [PATCH] show edits as pending --- src/renderer/component/fileCard/view.jsx | 4 ++-- src/renderer/redux/actions/publish.js | 2 +- src/renderer/redux/reducers/publish.js | 7 ++----- src/renderer/redux/selectors/publish.js | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/renderer/component/fileCard/view.jsx b/src/renderer/component/fileCard/view.jsx index 4cc30bf15..03777b0c5 100644 --- a/src/renderer/component/fileCard/view.jsx +++ b/src/renderer/component/fileCard/view.jsx @@ -43,9 +43,9 @@ class FileCard extends React.PureComponent { } 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); } }; diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index c03011132..0cb6c0f76 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -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 })); }; diff --git a/src/renderer/redux/reducers/publish.js b/src/renderer/redux/reducers/publish.js index 5bf9bc1c7..b28c9b4cd 100644 --- a/src/renderer/redux/reducers/publish.js +++ b/src/renderer/redux/reducers/publish.js @@ -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, diff --git a/src/renderer/redux/selectors/publish.js b/src/renderer/redux/selectors/publish.js index 378fe7e00..6556a8932 100644 --- a/src/renderer/redux/selectors/publish.js +++ b/src/renderer/redux/selectors/publish.js @@ -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]; });