Skip to content

Commit

Permalink
(js) Fix mail filters with flags prefixed with $
Browse files Browse the repository at this point in the history
Fixes #4461
  • Loading branch information
cgx committed May 14, 2018
1 parent 371504e commit 6f042ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion UI/Templates/PreferencesUI/UIxFilterEditor.wox
Expand Up @@ -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>

Expand Down
7 changes: 6 additions & 1 deletion UI/WebServerResources/js/Preferences/Preferences.service.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 6f042ca

Please sign in to comment.