Skip to content

Commit e7a0421

Browse files
committed
fix: reinitialize inputs on New Task button click
Signed-off-by: Roman Romanov <[email protected]>
1 parent 999eb91 commit e7a0421

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/components/ContextChat/ContextChatInputForm.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ export default {
260260
taskType(newValue) {
261261
this.onTaskTypeChange()
262262
},
263+
inputs: {
264+
handler(newValue) {
265+
if (Object.keys(newValue).length === 0) {
266+
this.onInputsReset()
267+
}
268+
},
269+
},
263270
},
264271
265272
mounted() {
@@ -381,6 +388,12 @@ export default {
381388
})
382389
},
383390
onTaskTypeChange() {
391+
this.reinitializeInputs()
392+
},
393+
onInputsReset() {
394+
this.reinitializeInputs()
395+
},
396+
reinitializeInputs() {
384397
this.$emit('update:inputs', {
385398
prompt: this.inputs.prompt ?? '',
386399
limit: this.isSearch ? this.taskType.inputShapeDefaults?.limit : undefined,

0 commit comments

Comments
 (0)