(js) Fix mail filters with flags prefixed with $

Fixes #4461
This commit is contained in:
Francis Lachapelle
2018-05-14 10:31:41 -04:00
parent 371504e997
commit 6f042ca7d2
2 changed files with 7 additions and 2 deletions
@@ -164,7 +164,7 @@
<md-option value="flagged"><var:string label:value="Flagged"/></md-option>
<md-option value="junk"><var:string label:value="Junk"/></md-option>
<md-option value="not_junk"><var:string label:value="Not Junk"/></md-option>
<md-option ng-value="key" ng-repeat="(key, value) in filterEditor.labels">{{ value[0] }}</md-option>
<md-option ng-value="key" ng-repeat="(key, value) in filterEditor.labels track by key">{{ value[0] }}</md-option>
</md-select>
</md-input-container>
@@ -27,7 +27,12 @@
data.SOGoMailLabelsColorsValues = [];
_.forEach(data.SOGoMailLabelsColors, function (value, key) {
data.SOGoMailLabelsColorsKeys.push(key);
data.SOGoMailLabelsColorsValues.push(value);
data.SOGoMailLabelsColorsValues.push(value); // value is an array of the user-defined name and color
if (key.charAt(0) == '$') {
Object.defineProperty(data.SOGoMailLabelsColors, '_' + key,
Object.getOwnPropertyDescriptor(data.SOGoMailLabelsColors, key));
delete data.SOGoMailLabelsColors[key];
}
});
_.forEach(data.SOGoSieveFilters, function(filter) {