Fix issues related to search apps, notification duration, and loading icon on the explore page (#6374)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user