Skip to content

Commit

Permalink
Use some instead of includes to check task types
Browse files Browse the repository at this point in the history
Includes only works for flat arrays, we want the method `some` in
this case.
  • Loading branch information
anarute committed Dec 12, 2023
1 parent c5d0981 commit 9cc08c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/js/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ Ext.onReady(function(){
// Create and populate a record
var newTask = new taskRecord();
newTask.set('projectId', templateValues['projectId']);
if(templateValues && !taskTypeStore.data.items.includes(x => x.id == templateValues['ttype'])){
if(templateValues && !taskTypeStore.data.items.some(x => x.id == templateValues['ttype'])){
let message = `Task type of ${templateValues['ttype']} is not valid. The task type may have been deactivated. Please choose another task type.`
App.setAlert(false, message);
} else {
Expand Down

0 comments on commit 9cc08c0

Please sign in to comment.