Fix issues related to search apps, notification duration, and loading icon on the explore page (#6374)

This commit is contained in:
faye1225
2024-07-17 20:24:31 +08:00
committed by GitHub
parent a6dbd26f75
commit 65bc4e0fc0
6 changed files with 59 additions and 28 deletions

View File

@@ -136,7 +136,7 @@ const Debug: FC<IDebug> = ({
const { notify } = useContext(ToastContext)
const logError = useCallback((message: string) => {
notify({ type: 'error', message, duration: 3000 })
notify({ type: 'error', message })
}, [notify])
const [completionFiles, setCompletionFiles] = useState<VisionFile[]>([])
@@ -144,11 +144,11 @@ const Debug: FC<IDebug> = ({
if (isAdvancedMode && mode !== AppType.completion) {
if (modelModeType === ModelModeType.completion) {
if (!hasSetBlockStatus.history) {
notify({ type: 'error', message: t('appDebug.otherError.historyNoBeEmpty'), duration: 3000 })
notify({ type: 'error', message: t('appDebug.otherError.historyNoBeEmpty') })
return false
}
if (!hasSetBlockStatus.query) {
notify({ type: 'error', message: t('appDebug.otherError.queryNoBeEmpty'), duration: 3000 })
notify({ type: 'error', message: t('appDebug.otherError.queryNoBeEmpty') })
return false
}
}

View File

@@ -555,23 +555,23 @@ const Configuration: FC = () => {
const promptVariables = modelConfig.configs.prompt_variables
if (promptEmpty) {
notify({ type: 'error', message: t('appDebug.otherError.promptNoBeEmpty'), duration: 3000 })
notify({ type: 'error', message: t('appDebug.otherError.promptNoBeEmpty') })
return
}
if (isAdvancedMode && mode !== AppType.completion) {
if (modelModeType === ModelModeType.completion) {
if (!hasSetBlockStatus.history) {
notify({ type: 'error', message: t('appDebug.otherError.historyNoBeEmpty'), duration: 3000 })
notify({ type: 'error', message: t('appDebug.otherError.historyNoBeEmpty') })
return
}
if (!hasSetBlockStatus.query) {
notify({ type: 'error', message: t('appDebug.otherError.queryNoBeEmpty'), duration: 3000 })
notify({ type: 'error', message: t('appDebug.otherError.queryNoBeEmpty') })
return
}
}
}
if (contextVarEmpty) {
notify({ type: 'error', message: t('appDebug.feature.dataSet.queryVariable.contextVarNotEmpty'), duration: 3000 })
notify({ type: 'error', message: t('appDebug.feature.dataSet.queryVariable.contextVarNotEmpty') })
return
}
const postDatasets = dataSets.map(({ id }) => ({
@@ -638,7 +638,7 @@ const Configuration: FC = () => {
modelConfig: newModelConfig,
completionParams,
})
notify({ type: 'success', message: t('common.api.success'), duration: 3000 })
notify({ type: 'success', message: t('common.api.success') })
setCanReturnToSimpleMode(false)
return true