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

@ -244,7 +244,7 @@ class ComposeOpenPgpPopupView extends AbstractViewNext {
@command()
selectCommand() {
const keyId = this.selectedPrivateKey(),
option = keyId ? _.find(this.privateKeysOptions(), (item) => item && keyId === item.id) : null;
option = keyId ? this.privateKeysOptions().find(item => item && keyId === item.id) : null;
if (option) {
this.signKey({
@ -261,7 +261,7 @@ class ComposeOpenPgpPopupView extends AbstractViewNext {
addCommand() {
const keyId = this.selectedPublicKey(),
keys = this.encryptKeys(),
option = keyId ? _.find(this.publicKeysOptions(), (item) => item && keyId === item.id) : null;
option = keyId ? this.publicKeysOptions().find(item => item && keyId === item.id) : null;
if (option) {
keys.push({