JavaScript inArray()/indexOf() to .includes()

This commit is contained in:
djmaze 2020-07-20 14:33:33 +02:00
parent ec3fd5b7e4
commit db2d95d684
20 changed files with 69 additions and 86 deletions

View file

@ -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));
}
}