mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
Replace all new Intl.Collator with new baseCollator
This commit is contained in:
parent
70b1a93108
commit
7450afeecf
7 changed files with 17 additions and 9 deletions
|
|
@ -12,6 +12,8 @@ import { OpenPgpKeyPopupView } from 'View/Popup/OpenPgpKey';
|
|||
|
||||
import { Passphrases } from 'Storage/Passphrases';
|
||||
|
||||
import { baseCollator } from 'Common/Translator';
|
||||
|
||||
const
|
||||
findGnuPGKey = (keys, query/*, sign*/) =>
|
||||
keys.find(key =>
|
||||
|
|
@ -106,7 +108,7 @@ export const GnuPGUserStore = new class {
|
|||
key.view = () => key.fetch(() => showScreenPopup(OpenPgpKeyPopupView, [key]));
|
||||
return key;
|
||||
},
|
||||
collator = new Intl.Collator(undefined, {sensitivity: 'base'}),
|
||||
collator = baseCollator(),
|
||||
sort = keys => keys.sort(
|
||||
(a, b) => collator.compare(a.emails[0], b.emails[0]) || collator.compare(a.id, b.id)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { OpenPgpKeyPopupView } from 'View/Popup/OpenPgpKey';
|
|||
|
||||
import { Passphrases } from 'Storage/Passphrases';
|
||||
|
||||
import { baseCollator } from 'Common/Translator';
|
||||
|
||||
const
|
||||
findOpenPGPKey = (keys, query/*, sign*/) =>
|
||||
keys.find(key =>
|
||||
|
|
@ -39,7 +41,7 @@ const
|
|||
}
|
||||
},
|
||||
|
||||
collator = new Intl.Collator(undefined, {sensitivity: 'base'}),
|
||||
collator = baseCollator(),
|
||||
sort = keys => keys.sort(
|
||||
// (a, b) => collator.compare(a.emails[0], b.emails[0]) || collator.compare(a.fingerprint, b.fingerprint)
|
||||
(a, b) => collator.compare(a.emails[0], b.emails[0]) || collator.compare(a.id, b.id)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { addObservablesTo, koArrayWithDestroy } from 'External/ko';
|
||||
import { baseCollator } from 'Common/Translator';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
export const SMimeUserStore = koArrayWithDestroy();
|
||||
|
|
@ -12,7 +13,7 @@ SMimeUserStore.loadCertificates = () => {
|
|||
SMimeUserStore.loading(true);
|
||||
Remote.request('SMimeGetCertificates', (iError, oData) => {
|
||||
SMimeUserStore.loading(false);
|
||||
const collator = new Intl.Collator(undefined, {sensitivity: 'base'});
|
||||
const collator = baseCollator();
|
||||
iError || SMimeUserStore(oData.Result.sort(
|
||||
(a, b) => collator.compare(a.emailAddress, b.emailAddress) || (b.validTo_time_t - a.validTo_time_t)
|
||||
));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue