mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
JavaScript inArray()/indexOf() to .includes()
This commit is contained in:
parent
ec3fd5b7e4
commit
db2d95d684
20 changed files with 69 additions and 86 deletions
|
|
@ -3,7 +3,7 @@ import $ from '$';
|
|||
import ko from 'ko';
|
||||
import key from 'key';
|
||||
|
||||
import { inArray, pString, log, isUnd, trim, defautOptionsAfterRender } from 'Common/Utils';
|
||||
import { pString, log, isUnd, trim, defautOptionsAfterRender } from 'Common/Utils';
|
||||
|
||||
import { Magics, KeyState } from 'Common/Enums';
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
|
@ -64,7 +64,7 @@ class ComposeOpenPgpPopupView extends AbstractViewNext {
|
|||
|
||||
this.publicKeysOptions = ko.computed(() => {
|
||||
const opts = _.map(PgpStore.openpgpkeysPublic(), (oKey, index) => {
|
||||
if (-1 < inArray(oKey, this.encryptKeysView())) {
|
||||
if (this.encryptKeysView().includes(oKey)) {
|
||||
return null;
|
||||
}
|
||||
return _.map(oKey.users, (user) => ({
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import {
|
|||
import {
|
||||
delegateRunOnDestroy,
|
||||
computedPagenatorHelper,
|
||||
inArray,
|
||||
trim,
|
||||
windowResizeCallback,
|
||||
isNonEmptyArray,
|
||||
|
|
@ -101,11 +100,11 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
this.viewPropertiesNames = ko.computed(() =>
|
||||
_.filter(
|
||||
this.viewProperties(),
|
||||
(property) => -1 < inArray(property.type(), [ContactPropertyType.FirstName, ContactPropertyType.LastName])
|
||||
(property) => [ContactPropertyType.FirstName, ContactPropertyType.LastName].includes(property.type())
|
||||
)
|
||||
);
|
||||
this.viewPropertiesOther = ko.computed(() =>
|
||||
_.filter(this.viewProperties(), (property) => -1 < inArray(property.type(), [ContactPropertyType.Nick]))
|
||||
_.filter(this.viewProperties(), (property) => [ContactPropertyType.Nick].includes(property.type()))
|
||||
);
|
||||
|
||||
this.viewPropertiesEmails = ko.computed(() =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue