Skip to content

Commit 88deeda

Browse files
perf: add problem filter repeat
1 parent bdea68c commit 88deeda

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ui/src/views/dataset/component/EditParagraphDialog.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,14 @@ function delProblemHandle(item: any, index: number) {
9898
}
9999
function addProblemHandle() {
100100
if (problemValue.value.trim()) {
101-
detail.value?.problem_list?.push({
102-
content: problemValue.value.trim()
103-
})
101+
if (
102+
!detail.value?.problem_list.some((item: any) => item.content === problemValue.value.trim())
103+
) {
104+
detail.value?.problem_list?.push({
105+
content: problemValue.value.trim()
106+
})
107+
}
108+
104109
problemValue.value = ''
105110
isAddProblem.value = false
106111
}

0 commit comments

Comments
 (0)