Quick fix "uki"
@@ -340,8 +340,8 @@ function genComponentConf() {
this.isNew = false;
- this.tempMContext = this.$ngRedux.getState().getIn(['config', 'theme', 'defaultContext']);
- this.tempMatchingContext = this.tempMContext? this.tempMContext.toJS() : [];
+ this.defaultContext = this.$ngRedux.getState().getIn(['config', 'theme', 'defaultContext']);
+ this.tempMatchingContext = this.defaultContext? this.defaultContext.toJS() : ["uki"];
this.tempMatchingString = this.tempMatchingContext? this.tempMatchingContext.join(" ") : "";
const selectFromState = (state) => {
@@ -449,32 +449,13 @@ function genComponentConf() {
}
mergeMatchingContext() {
-
- //return (this.matchingContextString? this.matchingContextString.match(/(\S+)/gi) : []);
-
- //var names = ["Mike","Matt","Nancy","Adam","Jenny","Nancy","Carl"];
-
var list = this.tempMatchingString? this.tempMatchingString.match(/(\S+)/gi) : [];
var uniq = list.reduce(function(a,b){
if (a.indexOf(b) < 0 ) a.push(b);
return a;
},[]);
- //console.log(uniq, names) // [ 'Mike', 'Matt', 'Nancy', 'Adam', 'Jenny', 'Carl' ]
-
- // one liner
return list.reduce(function(a,b){if(a.indexOf(b)<0)a.push(b);return a;},[]);
-
- /*
- //let detailContext = Immutable.Set(this.matchingContextString? this.matchingContextString.match(/(\S+)/gi) : []).map(context => context.substr(1)).toJS();
- let detailContext = Immutable.Set(this.matchingContextString? this.matchingContextString.match(/#(\S+)/gi) : []).map(context => context.substr(1)).toJS();
-
- let combinedContext = this.tempMatchingContext? detailContext.concat(this.tempMatchingContext) : detailContext;
-
- const immutableContextSet = Immutable.Set(combinedContext);
- return immutableContextSet.toJS();
- */
-
}
addMatchingContext() {
