@capillarytech/creatives-library 2.0.19 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,12 +6,15 @@ import {
|
|
|
6
6
|
import { injectIntl } from 'react-intl';
|
|
7
7
|
import classnames from 'classnames';
|
|
8
8
|
import {isEmpty} from 'lodash';
|
|
9
|
+
import { connect } from 'react-redux';
|
|
10
|
+
import { bindActionCreators } from 'redux';
|
|
9
11
|
import SlideBoxContent from './SlideBoxContent';
|
|
10
12
|
import SlideBoxHeader from './SlideBoxHeader';
|
|
11
13
|
import SlideBoxFooter from './SlideBoxFooter';
|
|
12
14
|
import * as constants from './constants';
|
|
13
15
|
import './index.scss';
|
|
14
|
-
|
|
16
|
+
import * as templateActions from '../Templates/actions';
|
|
17
|
+
import * as globalActions from '../Cap/actions';
|
|
15
18
|
|
|
16
19
|
const classPrefix = 'add-creatives-section';
|
|
17
20
|
class Creatives extends React.Component {
|
|
@@ -26,6 +29,8 @@ class Creatives extends React.Component {
|
|
|
26
29
|
}
|
|
27
30
|
componentWillUnmount() {
|
|
28
31
|
console.log("unmounting creatives");
|
|
32
|
+
this.props.templateActions.resetTemplateStoreData();
|
|
33
|
+
this.props.globalActions.clearMetaEntities();
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
|
|
@@ -189,5 +194,13 @@ Creatives.propTypes = {
|
|
|
189
194
|
templateData: PropTypes.object,
|
|
190
195
|
isFullMode: PropTypes.bool,
|
|
191
196
|
channel: PropTypes.string,
|
|
197
|
+
templateActions: PropTypes.object,
|
|
198
|
+
globalActions: PropTypes.object,
|
|
192
199
|
};
|
|
193
|
-
|
|
200
|
+
function mapDispatchToProps(dispatch) {
|
|
201
|
+
return {
|
|
202
|
+
templateActions: bindActionCreators(templateActions, dispatch),
|
|
203
|
+
globalActions: bindActionCreators(globalActions, dispatch),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
export default connect(null, mapDispatchToProps)(injectIntl(Creatives));
|
|
@@ -349,6 +349,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
349
349
|
console.log('removed listener templates');
|
|
350
350
|
window.removeEventListener("message", this.handleFrameTasks);
|
|
351
351
|
this.props.actions.resetTemplateStoreData();
|
|
352
|
+
this.props.globalActions.clearMetaEntities();
|
|
352
353
|
// this.setState({defaultAccount: false});
|
|
353
354
|
}
|
|
354
355
|
|