mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +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
|
|
@ -6,7 +6,7 @@ import progressJs from 'progressJs';
|
|||
import { root } from 'Common/Links';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { pInt, isNormal, isArray, inArray, isUnd } from 'Common/Utils';
|
||||
import { pInt, isNormal, isArray, isUnd } from 'Common/Utils';
|
||||
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ class AdminApp extends AbstractApp {
|
|||
if (
|
||||
data &&
|
||||
data.ErrorCode &&
|
||||
-1 < inArray(pInt(data.ErrorCode), [Notification.LicensingServerIsUnavailable, Notification.LicensingExpired])
|
||||
[Notification.LicensingServerIsUnavailable, Notification.LicensingExpired].includes(pInt(data.ErrorCode))
|
||||
) {
|
||||
LicenseStore.licenseError(getNotification(pInt(data.ErrorCode)));
|
||||
LicenseStore.licensing(true);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import {
|
|||
log,
|
||||
has,
|
||||
isArray,
|
||||
inArray,
|
||||
isUnd,
|
||||
isNormal,
|
||||
isPosNumeric,
|
||||
|
|
@ -342,7 +341,7 @@ class AppUser extends AbstractApp {
|
|||
} else {
|
||||
setFolderHash(FolderStore.currentFolderFullNameRaw(), '');
|
||||
|
||||
if (oData && -1 < inArray(oData.ErrorCode, [Notification.CantMoveMessage, Notification.CantCopyMessage])) {
|
||||
if (oData && [Notification.CantMoveMessage, Notification.CantCopyMessage].includes(oData.ErrorCode)) {
|
||||
window.alert(getNotification(oData.ErrorCode));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue