Chore/cleanup warnings (#17974)

This commit is contained in:
crazywoola
2025-04-14 11:27:14 +08:00
committed by GitHub
parent f84832e0c2
commit 8f9cbe1c49
69 changed files with 89 additions and 117 deletions

View File

@@ -56,7 +56,7 @@ const AddAnnotationModal: FC<Props> = ({
try {
await onAdd(payload)
}
catch (e) {
catch {
}
setIsSaving(false)

View File

@@ -90,7 +90,7 @@ const Annotation: FC<Props> = ({
setList(data as AnnotationItem[])
setTotal(total)
}
catch (e) {
catch {
}
setIsLoading(false)

View File

@@ -55,7 +55,7 @@ const ViewAnnotationModal: FC<Props> = ({
setHitHistoryList(data as HitHistoryItem[])
setTotal(total)
}
catch (e) {
catch {
}
}

View File

@@ -88,7 +88,7 @@ const SettingBuiltInTool: FC<Props> = ({
setTempSetting(addDefaultValue(setting, formSchemas))
}
}
catch (e) { }
catch { }
setIsLoading(false)
})()
}, [collection?.name, collection?.id, collection?.type])

View File

@@ -150,7 +150,7 @@ const SettingsModal: FC<SettingsModalProps> = ({
retrieval_model_dict: retrievalConfig,
})
}
catch (e) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
}
finally {

View File

@@ -153,7 +153,7 @@ const Apps = ({
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
getRedirection(isCurrentWorkspaceEditor, { id: app.app_id!, mode }, push)
}
catch (e) {
catch {
Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
}
}

View File

@@ -90,7 +90,7 @@ function CreateApp({ onClose, onSuccess, onCreateFromTemplate }: CreateAppProps)
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
getRedirection(isCurrentWorkspaceEditor, app, push)
}
catch (e) {
catch {
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
}
isCreatingRef.current = false
@@ -287,7 +287,6 @@ type AppTypeCardProps = {
onClick: () => void
}
function AppTypeCard({ icon, title, description, active, onClick }: AppTypeCardProps) {
const { t } = useTranslation()
return <div
className={
cn(`relative box-content h-[84px] w-[191px] cursor-pointer rounded-xl

View File

@@ -30,7 +30,7 @@ const LogAnnotation: FC<Props> = ({
{ value: PageType.log, text: t('appLog.title') },
{ value: PageType.annotation, text: t('appAnnotation.title') },
]
}, [appDetail])
}, [appDetail?.mode, t])
if (!appDetail) {
return (

View File

@@ -547,7 +547,7 @@ const CompletionConversationDetailComp: FC<{ appId?: string; conversationId?: st
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
return true
}
catch (err) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false
}
@@ -560,7 +560,7 @@ const CompletionConversationDetailComp: FC<{ appId?: string; conversationId?: st
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
return true
}
catch (err) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false
}
@@ -591,7 +591,7 @@ const ChatConversationDetailComp: FC<{ appId?: string; conversationId?: string }
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
return true
}
catch (err) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false
}
@@ -603,7 +603,7 @@ const ChatConversationDetailComp: FC<{ appId?: string; conversationId?: string }
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
return true
}
catch (err) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false
}

View File

@@ -82,7 +82,7 @@ const SwitchAppModal = ({ show, appDetail, inAppDetail = false, onSuccess, onClo
removeOriginal ? replace : push,
)
}
catch (e) {
catch {
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
}
}