fix livestream redirect to dashboard
This commit is contained in:
parent
8755c634ad
commit
9e86cab4eb
2 changed files with 6 additions and 3 deletions
|
@ -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') {
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue