From 9e86cab4eba65c11e25eafce3d0a900ddfcb38b8 Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 26 Mar 2021 18:03:16 -0400 Subject: [PATCH] fix livestream redirect to dashboard --- ui/modal/modalPublishPreview/view.jsx | 3 ++- ui/redux/actions/publish.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/modal/modalPublishPreview/view.jsx b/ui/modal/modalPublishPreview/view.jsx index b6901a23f..2d0ec8731 100644 --- a/ui/modal/modalPublishPreview/view.jsx +++ b/ui/modal/modalPublishPreview/view.jsx @@ -11,6 +11,7 @@ import LbcSymbol from 'component/common/lbc-symbol'; import ChannelThumbnail from 'component/channelThumbnail'; import * as ICONS from 'constants/icons'; import Icon from 'component/common/icon'; +import { NO_FILE } from 'redux/actions/publish'; type Props = { filePath: string | WebFile, @@ -52,7 +53,7 @@ class ModalPublishPreview extends React.PureComponent { resolveFilePathName(filePath: string | WebFile) { if (!filePath) { - return '---'; + return NO_FILE; } if (typeof filePath === 'string') { diff --git a/ui/redux/actions/publish.js b/ui/redux/actions/publish.js index d258bb778..aa9b6715c 100644 --- a/ui/redux/actions/publish.js +++ b/ui/redux/actions/publish.js @@ -14,7 +14,7 @@ import { doError } from 'redux/actions/notifications'; import { push } from 'connected-react-router'; import analytics from 'analytics'; import { doOpenModal } from 'redux/actions/app'; - +export const NO_FILE = '---'; export const doPublishDesktop = (filePath: string, preview?: boolean) => (dispatch: Dispatch, getState: () => {}) => { const publishPreview = (previewResponse) => { dispatch( @@ -24,6 +24,8 @@ export const doPublishDesktop = (filePath: string, preview?: boolean) => (dispat ); }; + const noFile = !filePath || filePath === NO_FILE; + const publishSuccess = (successResponse, lbryFirstError) => { const state = getState(); const myClaims = selectMyClaims(state); @@ -91,7 +93,7 @@ export const doPublishDesktop = (filePath: string, preview?: boolean) => (dispat // on the publishes page. This doesn't exist on desktop so wait until we get a response // from the SDK // @if TARGET='web' - dispatch(push(filePath ? `/$/${PAGES.UPLOADS}` : `/$/${PAGES.LIVESTREAM}`)); + dispatch(push(noFile ? `/$/${PAGES.UPLOADS}` : `/$/${PAGES.LIVESTREAM}`)); // @endif dispatch(doPublish(publishSuccess, publishFail));