feat(conversations): add message creation limit lock
This commit is contained in:
@@ -3,7 +3,7 @@ import { ref } from 'vue';
|
||||
import CopilotEditor from 'dashboard/components/widgets/WootWriter/CopilotEditor.vue';
|
||||
import CaptainLoader from 'dashboard/components/widgets/conversation/copilot/CaptainLoader.vue';
|
||||
|
||||
defineProps({
|
||||
const props = defineProps({
|
||||
showCopilotEditor: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
@@ -16,6 +16,10 @@ defineProps({
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
isMessageCreationLocked: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
@@ -41,6 +45,8 @@ const clearEditorSelection = () => {
|
||||
};
|
||||
|
||||
const onSend = () => {
|
||||
if (props.isMessageCreationLocked) return;
|
||||
|
||||
emit('send', copilotEditorContent.value);
|
||||
copilotEditorContent.value = '';
|
||||
};
|
||||
@@ -58,7 +64,9 @@ const onSend = () => {
|
||||
@after-enter="emit('contentReady')"
|
||||
>
|
||||
<CopilotEditor
|
||||
v-if="showCopilotEditor && !isGeneratingContent"
|
||||
v-if="
|
||||
showCopilotEditor && !isGeneratingContent && !isMessageCreationLocked
|
||||
"
|
||||
key="copilot-editor"
|
||||
v-model="copilotEditorContent"
|
||||
class="copilot-editor"
|
||||
|
||||
Reference in New Issue
Block a user