webmail: fix case where tree of mailboxes wasn't displayed properly

for example, when these mailboxes existed: "a", "a.b", "a/b", then "a.b" (.
before / in ascii) prevented "a/b" from being displayed in the tree below "a".
This commit is contained in:
Mechiel Lukkien 2023-08-23 14:57:05 +02:00
parent aebfd78a9f
commit affb057a0c
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

View file

@ -3321,6 +3321,15 @@ const newMailboxlistView = (msglistView, requestNewView, updatePageTitle, setLoc
else if (ai >= 0 && bi >= 0 && ai !== bi) { else if (ai >= 0 && bi >= 0 && ai !== bi) {
return ai < bi ? -1 : 1; return ai < bi ? -1 : 1;
} }
const la = mbva.mailbox.Name.split('/');
const lb = mbvb.mailbox.Name.split('/');
let n = Math.min(la.length, lb.length);
for (let i = 0; i < n; i++) {
if (la[i] === lb[i]) {
continue;
}
return la[i] < lb[i] ? -1 : 1;
}
return mbva.mailbox.Name < mbvb.mailbox.Name ? -1 : 1; return mbva.mailbox.Name < mbvb.mailbox.Name ? -1 : 1;
}); });
let prevmailboxname = ''; let prevmailboxname = '';

View file

@ -3144,6 +3144,15 @@ const newMailboxlistView = (msglistView: MsglistView, requestNewView: requestNew
} else if (ai >= 0 && bi >= 0 && ai !== bi) { } else if (ai >= 0 && bi >= 0 && ai !== bi) {
return ai < bi ? -1 : 1 return ai < bi ? -1 : 1
} }
const la = mbva.mailbox.Name.split('/')
const lb = mbvb.mailbox.Name.split('/')
let n = Math.min(la.length, lb.length)
for (let i = 0; i < n; i++) {
if (la[i] === lb[i]) {
continue
}
return la[i] < lb[i] ? -1 : 1
}
return mbva.mailbox.Name < mbvb.mailbox.Name ? -1 : 1 return mbva.mailbox.Name < mbvb.mailbox.Name ? -1 : 1
}) })