From 486f15eba148d6b5f19f83766d7d90279507413b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 13 Nov 2019 10:59:34 -0500 Subject: [PATCH] redirect to publishes page after publish immediately on web --- static/app-strings.json | 2 +- ui/redux/actions/publish.js | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index e09b3b4d5..ce6680eda 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -870,4 +870,4 @@ "Look what's %trending% or %discover%": "Look what's %trending% or %discover%", "Sorry, your request timed out. %again%": "Sorry, your request timed out. %again%", "If you continue to have issues, please %support%.": "If you continue to have issues, please %support%." -} \ No newline at end of file +} diff --git a/ui/redux/actions/publish.js b/ui/redux/actions/publish.js index 37055ddad..6f6f4a596 100644 --- a/ui/redux/actions/publish.js +++ b/ui/redux/actions/publish.js @@ -18,7 +18,9 @@ export const doPublishDesktop = (filePath: string) => (dispatch: Dispatch, getSt const { permanent_url: url } = pendingClaim; const actions = []; + // @if TARGET='app' actions.push(push(`/$/${PAGES.PUBLISHED}`)); + // @endif actions.push({ type: ACTIONS.PUBLISH_SUCCESS, @@ -32,7 +34,13 @@ export const doPublishDesktop = (filePath: string) => (dispatch: Dispatch, getSt const myNewClaims = isEdit ? myClaims.map(claim => (isMatch(claim) ? pendingClaim : claim)) : myClaims.concat(pendingClaim); - actions.push(doOpenModal(MODALS.PUBLISH, { uri: url, isEdit, filePath })); + actions.push( + doOpenModal(MODALS.PUBLISH, { + uri: url, + isEdit, + filePath, + }) + ); actions.push({ type: ACTIONS.FETCH_CLAIM_LIST_MINE_COMPLETED, data: { @@ -44,11 +52,20 @@ export const doPublishDesktop = (filePath: string) => (dispatch: Dispatch, getSt const publishFail = error => { const actions = []; - actions.push({ type: ACTIONS.PUBLISH_FAIL }); + actions.push({ + type: ACTIONS.PUBLISH_FAIL, + }); actions.push(doError(error.message)); dispatch(batchActions(...actions)); }; + // Redirect on web immediately because we have a file upload progress componenet + // on the publishes page. This doesn't exist on desktop so wait until we get a response + // from the SDK + // @if TARGET='web' + actions.push(push(`/$/${PAGES.PUBLISHED}`)); + // @endif + dispatch(doPublish(publishSuccess, publishFail)); };