correctly set active channel on edits

This commit is contained in:
Sean Yesmunt 2021-02-15 11:58:04 -05:00
parent 92fc807e3d
commit 5ef19696a9

View file

@ -9,7 +9,7 @@ import {
import { makeSelectCostInfoForUri } from 'lbryinc';
import { doSetPlayingUri } from 'redux/actions/content';
import { doToast } from 'redux/actions/notifications';
import { doOpenModal } from 'redux/actions/app';
import { doOpenModal, doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
import fs from 'fs';
import FileActions from './view';
import { makeSelectFileRenderModeForUri } from 'redux/selectors/content';
@ -23,11 +23,19 @@ const select = (state, props) => ({
myChannels: selectMyChannelClaims(state),
});
const perform = dispatch => ({
const perform = (dispatch) => ({
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
prepareEdit: (publishData, uri, fileInfo) => dispatch(doPrepareEdit(publishData, uri, fileInfo, fs)),
prepareEdit: (publishData, uri, fileInfo) => {
if (publishData.signing_channel) {
dispatch(doSetActiveChannel(publishData.signing_channel.claim_id));
} else {
dispatch(doSetIncognito(true));
}
dispatch(doPrepareEdit(publishData, uri, fileInfo, fs));
},
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
doToast: options => dispatch(doToast(options)),
doToast: (options) => dispatch(doToast(options)),
});
export default connect(select, perform)(FileActions);