@capillarytech/creatives-library 8.0.67 → 8.0.68-alpha.0
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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by vivek on 22/5/17.
|
|
3
3
|
*/
|
|
4
|
-
import { fromJS } from 'immutable';
|
|
4
|
+
import { fromJS, Map as ImmutableMap } from 'immutable';
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
import * as types from './constants';
|
|
7
7
|
import initialState from '../../initialState';
|
|
@@ -113,12 +113,19 @@ function capReducer(state = fromJS(initialState.cap), action) {
|
|
|
113
113
|
// Process extended tags
|
|
114
114
|
const extendedSubtags = getTagMapValue(action?.data?.metaEntities?.extended);
|
|
115
115
|
|
|
116
|
+
const getExistingTagLookupMap = (state) => {
|
|
117
|
+
const tagLookupMap = state.getIn(['metaEntities', 'tagLookupMap']);
|
|
118
|
+
return state.get('metaEntities') && ImmutableMap.isMap(tagLookupMap)
|
|
119
|
+
? tagLookupMap.toJS()
|
|
120
|
+
: {};
|
|
121
|
+
};
|
|
122
|
+
|
|
116
123
|
// Combine all maps
|
|
117
124
|
const combinedTagMap = {
|
|
118
125
|
...standardTagMap,
|
|
119
126
|
...customSubtags,
|
|
120
127
|
...extendedSubtags,
|
|
121
|
-
...state
|
|
128
|
+
...getExistingTagLookupMap(state),
|
|
122
129
|
};
|
|
123
130
|
const stateMeta = state.get("metaEntities");
|
|
124
131
|
return state
|