Skip to content

Commit

Permalink
Merge pull request #6132 from nextcloud/enh/noid/task-result-buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Aug 7, 2024
2 parents 2996339 + eacd109 commit 0cc1a00
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/Assistant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,19 @@ export default {
emit('text:translate-modal:show', { content: this.selection || '' })
},
async openResult(task) {
window.OCA.Assistant.openAssistantTask(task)
window.OCA.Assistant.openAssistantTask(task, {
isInsideViewer: true,
actionButtons: [
{
type: 'primary',
title: t('text', 'Insert result'),
label: t('text', 'Insert result'),
onClick: (lastTask) => {
this.insertResult(lastTask)
},
},
],
})
},
async insertResult(task) {
this.$editor.commands.insertContent(task.output.output)
Expand Down

0 comments on commit 0cc1a00

Please sign in to comment.