Skip to content

Commit c4fd921

Browse files
committed
fix: ensure filterList is properly initialized and updated in getList function
1 parent b2ad983 commit c4fd921

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ui/src/views/tool/toolStore/ToolStoreDialog.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ function open(id: string) {
161161
}
162162
163163
async function getList() {
164+
filterList.value = null
164165
if (toolType.value === 'DATA_SOURCE') {
165166
categories.value = [
166167
{
@@ -194,7 +195,7 @@ async function getInternalToolList() {
194195
const categories = defaultCategories.value
195196
const res = await ToolStoreApi.getInternalToolList({ name: searchValue.value }, loading)
196197
if (searchValue.value.length) {
197-
filterList.value = res.data
198+
filterList.value = [...res.data, ...filterList.value || []]
198199
} else {
199200
filterList.value = null
200201
categories.forEach((category) => {
@@ -223,7 +224,7 @@ async function getStoreToolList() {
223224
tool.desc = tool.description
224225
})
225226
if (searchValue.value.length) {
226-
filterList.value = res.data.apps
227+
filterList.value = [...res.data.apps, ...filterList.value || []]
227228
} else {
228229
filterList.value = null
229230
categories = tags.map((tag: any) => ({

0 commit comments

Comments
 (0)