From efb1efe3d9ba62bd9cce3ce21f2e4e478eb6bdcf Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Mon, 19 Mar 2018 10:13:01 +0100 Subject: [PATCH] use includes instead of indexOf --- src/utils/undoFilter.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/undoFilter.js b/src/utils/undoFilter.js index 0a348f5..dc17665 100644 --- a/src/utils/undoFilter.js +++ b/src/utils/undoFilter.js @@ -41,10 +41,8 @@ const CONTEXT_TOOL_CHANGES = [ ]; export default function undoFilter(action, currentState) { - if (INCLUDE.indexOf(action.type) !== -1) return true; - if (ACTION_INCLUDES[action.type] && ACTION_INCLUDES[action.type].indexOf(currentState.d2.tool) !== -1) { - return true; - } + if (INCLUDE.includes(action.type)) return true; + if (ACTION_INCLUDES[action.type] && ACTION_INCLUDES[action.type].includes(currentState.d2.tool)) return true; if (action.type === actions.CONTEXT_CHANGE_TOOL && CONTEXT_TOOL_CHANGES.includes(action.tool)) return true; return false;