From 477c1fe2f2fcd2da6099eb8a3a1a542a54fd7859 Mon Sep 17 00:00:00 2001 From: Yagami Date: Thu, 2 Mar 2023 09:19:05 +0800 Subject: [PATCH] * Fix bug #32577. --- module/task/js/create.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/module/task/js/create.js b/module/task/js/create.js index 5244f4426d..52497f9380 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -619,7 +619,7 @@ $(document).on('click', '#testStory_chosen', function() $('#modalTeam tfoot .btn').click(function() { - var team = ''; + var team = []; var time = 0; var error = false; var mode = $('[name="mode"]').val(); @@ -630,7 +630,7 @@ $('#modalTeam tfoot .btn').click(function() var tr = $(this).closest('tr'); var account = $(this).find('option:selected').text(); - team += ' ' + account; + if(!team.includes(account)) team.push(account); estimate = parseFloat($(this).parents('td').next('td').find('[name^=teamEstimate]').val()); if(!isNaN(estimate) && estimate > 0) time += estimate; @@ -643,8 +643,7 @@ $('#modalTeam tfoot .btn').click(function() }); if(error) return false; - var teamList = team.split(" "); - if(teamList.length <= 2) + if(team.length < 2) { bootbox.alert(teamMemberError); return false;