fix livestream redirect to dashboard

This commit is contained in:
zeppi 2021-03-26 18:03:16 -04:00 committed by jessopb
parent 8755c634ad
commit 9e86cab4eb
2 changed files with 6 additions and 3 deletions

View file

@ -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<Props> {
resolveFilePathName(filePath: string | WebFile) {
if (!filePath) {
return '---';
return NO_FILE;
}
if (typeof filePath === 'string') {

View file

@ -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));