Underscore.js _.find() to native Array.find()

This commit is contained in:
djmaze 2020-07-22 10:43:19 +02:00
parent 2404f6466d
commit 9c0072d626
19 changed files with 55 additions and 79 deletions

View file

@ -56,7 +56,7 @@ class GeneralUserSettings {
this.identityMain = ko.computed(() => {
const list = this.identities();
return isArray(list) ? _.find(list, (item) => item && '' === item.id()) : null;
return isArray(list) ? list.find(item => item && '' === item.id()) : null;
});
this.identityMainDesc = ko.computed(() => {

View file

@ -50,7 +50,7 @@ class OpenPgpUserSettings {
this.openPgpKeyForDeletion(null);
if (openPgpKeyToRemove && PgpStore.openpgpKeyring) {
const findedItem = _.find(PgpStore.openpgpkeys(), (key) => openPgpKeyToRemove === key);
const findedItem = PgpStore.openpgpkeys().find(key => openPgpKeyToRemove === key);
if (findedItem) {
PgpStore.openpgpkeys.remove(findedItem);
delegateRunOnDestroy(findedItem);