File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -435,18 +435,24 @@ export default {
435435 || this .myInputs ? .source_input // used in context write
436436 || this .myInputs ? .text // used in document generation
437437
438+ if (typeof lastInput === ' string' || lastInput instanceof String ) {
439+ OCA .Assistant .last_text_input = lastInput
440+ }
441+
438442 this .$refs ? .translateForm ? .setDefaultValues (true )
439443 this .$refs ? .assistantFormInputs ? .setDefaultValues (true )
440444
441- // keep last prompt if new task type has text input
442- if (lastInput && this .selectedTaskType ? .inputShape ? .input ) {
443- this .myInputs .input = lastInput
444- }
445- if (lastInput && this .selectedTaskType ? .inputShape ? .source_input ) {
446- this .myInputs .source_input = lastInput
447- }
448- if (lastInput && this .selectedTaskType ? .inputShape ? .text ) {
449- this .myInputs .text = lastInput
445+ // keep last prompt if it's a string and if the new task type has text input
446+ if (OCA .Assistant .last_text_input ) {
447+ if (this .selectedTaskType ? .inputShape ? .input && this .selectedTaskType ? .inputShape ? .input .type === SHAPE_TYPE_NAMES .Text ) {
448+ this .myInputs .input = OCA .Assistant .last_text_input
449+ }
450+ if (this .selectedTaskType ? .inputShape ? .source_input && this .selectedTaskType ? .inputShape ? .source_input .type === SHAPE_TYPE_NAMES .Text ) {
451+ this .myInputs .source_input = OCA .Assistant .last_text_input
452+ }
453+ if (this .selectedTaskType ? .inputShape ? .text && this .selectedTaskType ? .inputShape ? .text .type === SHAPE_TYPE_NAMES .Text ) {
454+ this .myInputs .text = OCA .Assistant .last_text_input
455+ }
450456 }
451457 },
452458 onSyncSubmit () {
You can’t perform that action at this time.
0 commit comments