perf: Optimization user input auto close when send message

v3.2
wangdan-fit2cloud 2025-04-03 10:34:51 +08:00 committed by GitHub
parent 69ae1cafab
commit 86e11baeb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 12 deletions

View File

@ -221,10 +221,9 @@ const checkInputParam = () => {
} }
function sendMessage(val: string, other_params_data?: any, chat?: chatType) { function sendMessage(val: string, other_params_data?: any, chat?: chatType) {
if (!userFormRef.value?.checkInputParam()) {
if (isUserInput.value) { if (isUserInput.value) {
if (!userFormRef.value?.checkInputParam()) {
showUserInput.value = true showUserInput.value = true
}
return return
} else { } else {
let userFormData = JSON.parse(localStorage.getItem(`${accessToken}userForm`) || '{}') let userFormData = JSON.parse(localStorage.getItem(`${accessToken}userForm`) || '{}')
@ -235,6 +234,8 @@ function sendMessage(val: string, other_params_data?: any, chat?: chatType) {
return result return result
}, {}) }, {})
localStorage.setItem(`${accessToken}userForm`, JSON.stringify(newData)) localStorage.setItem(`${accessToken}userForm`, JSON.stringify(newData))
showUserInput.value = false
}
} }
if (!loading.value && props.applicationDetails?.name) { if (!loading.value && props.applicationDetails?.name) {
handleDebounceClick(val, other_params_data, chat) handleDebounceClick(val, other_params_data, chat)