mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
In Preferences > Folders, decode path UTF7
This commit is contained in:
parent
e572e6d186
commit
6fa52ca823
1 changed files with 7 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
|||
import utf7 from 'utf7';
|
||||
import {
|
||||
RetinaImg,
|
||||
DropdownMenu,
|
||||
|
@ -25,8 +26,8 @@ export default class CategorySelection extends React.Component {
|
|||
_itemsForCategories() {
|
||||
return this.props.all
|
||||
.sort((a, b) => {
|
||||
var pathA = a.path.toUpperCase();
|
||||
var pathB = b.path.toUpperCase();
|
||||
var pathA = utf7.imap.decode(a.path).toUpperCase();
|
||||
var pathB = utf7.imap.decode(b.path).toUpperCase();
|
||||
if (pathA < pathB) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -35,7 +36,7 @@ export default class CategorySelection extends React.Component {
|
|||
}
|
||||
return 0;
|
||||
})
|
||||
.filter(c => Utils.wordSearchRegExp(this.state.searchValue).test(c.path))
|
||||
.filter(c => Utils.wordSearchRegExp(this.state.searchValue).test(utf7.imap.decode(c.path)))
|
||||
.map(c => {
|
||||
c.backgroundColor = LabelColorizer.backgroundColorDark(c);
|
||||
return c;
|
||||
|
@ -61,11 +62,13 @@ export default class CategorySelection extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
const displayPath = utf7.imap.decode(item.path);
|
||||
|
||||
return (
|
||||
<div className="category-item">
|
||||
{icon}
|
||||
<div className="category-display-name">
|
||||
<BoldedSearchResult value={item.path} query={this.state.searchValue || ''} />
|
||||
<BoldedSearchResult value={displayPath} query={this.state.searchValue || ''} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue