42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", {
|
||
|
value: true
|
||
|
});
|
||
|
exports.default = void 0;
|
||
|
|
||
|
var _reactRedux = require("react-redux");
|
||
|
|
||
|
var _publish = require("../../actions/publish");
|
||
|
|
||
|
var _view = _interopRequireDefault(require("./view"));
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||
|
var channel = _ref.channel,
|
||
|
publish = _ref.publish;
|
||
|
return {
|
||
|
loggedInChannelName: channel.loggedInChannel.name,
|
||
|
publishInChannel: publish.publishInChannel,
|
||
|
selectedChannel: publish.selectedChannel,
|
||
|
channelError: publish.error.channel
|
||
|
};
|
||
|
};
|
||
|
|
||
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
||
|
return {
|
||
|
onPublishInChannelChange: function onPublishInChannelChange(value) {
|
||
|
dispatch((0, _publish.updateError)('channel', null));
|
||
|
dispatch((0, _publish.setPublishInChannel)(value));
|
||
|
},
|
||
|
onChannelSelect: function onChannelSelect(value) {
|
||
|
dispatch((0, _publish.updateError)('channel', null));
|
||
|
dispatch((0, _publish.updateSelectedChannel)(value));
|
||
|
}
|
||
|
};
|
||
|
};
|
||
|
|
||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||
|
|
||
|
exports.default = _default;
|