diff --git a/app/javascript/dashboard/api/inbox/conversation.js b/app/javascript/dashboard/api/inbox/conversation.js index 39546096f..1a87e6d96 100644 --- a/app/javascript/dashboard/api/inbox/conversation.js +++ b/app/javascript/dashboard/api/inbox/conversation.js @@ -134,10 +134,6 @@ class ConversationApi extends ApiClient { return axios.get(`${this.url}/${conversationId}/attachments`); } - requestCopilot(conversationId, body) { - return axios.post(`${this.url}/${conversationId}/copilot`, body); - } - getInboxAssistant(conversationId) { return axios.get(`${this.url}/${conversationId}/inbox_assistant`); } diff --git a/app/javascript/dashboard/components-next/captain/PageLayout.vue b/app/javascript/dashboard/components-next/captain/PageLayout.vue index 7355ac616..495db1838 100644 --- a/app/javascript/dashboard/components-next/captain/PageLayout.vue +++ b/app/javascript/dashboard/components-next/captain/PageLayout.vue @@ -76,7 +76,7 @@ const handlePageChange = event => { diff --git a/app/javascript/dashboard/components-next/copilot/CopilotAssistantMessage.vue b/app/javascript/dashboard/components-next/copilot/CopilotAssistantMessage.vue index 0a37600bf..2447a7164 100644 --- a/app/javascript/dashboard/components-next/copilot/CopilotAssistantMessage.vue +++ b/app/javascript/dashboard/components-next/copilot/CopilotAssistantMessage.vue @@ -11,6 +11,10 @@ import MessageFormatter from 'shared/helpers/MessageFormatter.js'; import Button from 'dashboard/components-next/button/Button.vue'; const props = defineProps({ + isLastMessage: { + type: Boolean, + default: false, + }, message: { type: Object, required: true, @@ -20,6 +24,15 @@ const props = defineProps({ required: true, }, }); +const hasEmptyMessageContent = computed(() => !props.message?.content); + +const showUseButton = computed(() => { + return ( + !hasEmptyMessageContent.value && + props.message.reply_suggestion && + props.isLastMessage + ); +}); const messageContent = computed(() => { const formatter = new MessageFormatter(props.message.content); @@ -32,8 +45,6 @@ const insertIntoRichEditor = computed(() => { ); }); -const hasEmptyMessageContent = computed(() => !props.message?.content); - const useCopilotResponse = () => { if (insertIntoRichEditor.value) { emitter.emit(BUS_EVENTS.INSERT_INTO_RICH_EDITOR, props.message?.content); @@ -57,7 +68,7 @@ const useCopilotResponse = () => { />