Sort S/MIME certificates on emailAddress else validTo

This commit is contained in:
the-djmaze 2024-02-26 19:34:50 +01:00
parent 091895df38
commit 20daa1ce13

View file

@ -12,6 +12,9 @@ SMimeUserStore.loadCertificates = () => {
SMimeUserStore.loading(true);
Remote.request('SMimeGetCertificates', (iError, oData) => {
SMimeUserStore.loading(false);
iError || SMimeUserStore(oData.Result);
const collator = new Intl.Collator(undefined, {sensitivity: 'base'});
iError || SMimeUserStore(oData.Result.sort(
(a, b) => collator.compare(a.emailAddress, b.emailAddress) || (b.validTo_time_t - a.validTo_time_t)
));
});
};