Commit e3b28b52 authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

fix: 应用名称为空不允许生成头像&ai生成中不允许再次点击&应用名称校验

See merge request !80
parents 5270fd70 aff37beb
...@@ -206,6 +206,10 @@ function handleUploadAvatarOversize() { ...@@ -206,6 +206,10 @@ function handleUploadAvatarOversize() {
} }
async function handleAIGenerateAgentAvatar() { async function handleAIGenerateAgentAvatar() {
if (generateAgentAvatarLoading.value || !personalAppConfig.value.baseInfo.agentTitle) {
return
}
generateAgentAvatarLoading.value = true generateAgentAvatarLoading.value = true
generateAgentAvatarController = new AbortController() generateAgentAvatarController = new AbortController()
...@@ -223,6 +227,10 @@ async function handleAIGenerateAgentAvatar() { ...@@ -223,6 +227,10 @@ async function handleAIGenerateAgentAvatar() {
} }
async function handleAIGeneratePreamble() { async function handleAIGeneratePreamble() {
if (generatePreambleLoading.value) {
return
}
!commConfigExpandedNames.value.includes('preamble') && commConfigExpandedNames.value.push('preamble') !commConfigExpandedNames.value.includes('preamble') && commConfigExpandedNames.value.push('preamble')
generatePreambleLoading.value = true generatePreambleLoading.value = true
...@@ -252,6 +260,10 @@ async function handleAIGeneratePreamble() { ...@@ -252,6 +260,10 @@ async function handleAIGeneratePreamble() {
} }
async function handleAIGenerateFeaturedQuestions() { async function handleAIGenerateFeaturedQuestions() {
if (generateFeaturedQuestionsLoading.value) {
return
}
!commConfigExpandedNames.value.includes('featuredQuestions') && !commConfigExpandedNames.value.includes('featuredQuestions') &&
commConfigExpandedNames.value.push('featuredQuestions') commConfigExpandedNames.value.push('featuredQuestions')
...@@ -278,6 +290,7 @@ async function handleSettingAgent(autoConfigInputValue: string) { ...@@ -278,6 +290,7 @@ async function handleSettingAgent(autoConfigInputValue: string) {
await handleCreateAgentTitleAndDesc(autoConfigInputValue) await handleCreateAgentTitleAndDesc(autoConfigInputValue)
.then(() => { .then(() => {
personalAppFormRef.value?.validate()
Promise.all([ Promise.all([
handleAIGenerateAgentAvatar(), handleAIGenerateAgentAvatar(),
handleAIGeneratePreamble(), handleAIGeneratePreamble(),
...@@ -443,7 +456,7 @@ function handleStopGenerate() { ...@@ -443,7 +456,7 @@ function handleStopGenerate() {
<div <div
class="text-theme-color mt-3 flex h-[28px] items-center justify-between rounded-md border border-[#d4d6d9] px-2" class="text-theme-color mt-3 flex h-[28px] items-center justify-between rounded-md border border-[#d4d6d9] px-2"
:class=" :class="
generateAgentAvatarLoading generateAgentAvatarLoading || !personalAppConfig.baseInfo.agentTitle
? 'cursor-not-allowed opacity-50' ? 'cursor-not-allowed opacity-50'
: 'cursor-pointer hover:border-[#d4e5ff] hover:bg-[#e6f0ff]' : 'cursor-pointer hover:border-[#d4e5ff] hover:bg-[#e6f0ff]'
" "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment