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

@@ -391,7 +391,7 @@ export const useDSL = () => {
a.download = `${appDetail.name}.yml`
a.click()
}
catch (e) {
catch {
notify({ type: 'error', message: t('app.exportFailed') })
}
finally {
@@ -416,7 +416,7 @@ export const useDSL = () => {
},
} as any)
}
catch (e) {
catch {
notify({ type: 'error', message: t('app.exportFailed') })
}
}, [appDetail, eventEmitter, handleExportDSL, notify, t])

View File

@@ -123,7 +123,7 @@ const BeforeRunForm: FC<BeforeRunFormProps> = ({
const value = formatValue(form.values[input.variable], input.type)
submitData[input.variable] = value
}
catch (e) {
catch {
parseErrorJsonField = input.variable
}
})

View File

@@ -119,7 +119,7 @@ const CodeEditor: FC<Props> = ({
try {
return JSON.stringify(value as object, null, 2)
}
catch (e) {
catch {
return value as string
}
})()

View File

@@ -1,5 +1,3 @@
import type { CodeNodeType } from './types'
export const checkNodeValid = (payload: CodeNodeType) => {
export const checkNodeValid = () => {
return true
}

View File

@@ -71,7 +71,7 @@ const ConditionValue = ({
: ''
}
return ''
}, [])
}, [t])
return (
<div className='rounded-md bg-workflow-block-parma-bg'>

View File

@@ -141,7 +141,7 @@ const ConditionItem = ({
value: isArrayValue ? [value] : value,
}
doUpdateCondition(newCondition)
}, [condition, doUpdateCondition, fileAttr])
}, [condition, doUpdateCondition, isArrayValue])
const isSelect = condition.comparison_operator && [ComparisonOperator.in, ComparisonOperator.notIn].includes(condition.comparison_operator)
const selectOptions = useMemo(() => {

View File

@@ -133,7 +133,7 @@ const useConfig = (id: string, payload: IfElseNodeType) => {
})
setInputs(newInputs)
updateNodeInternals(id)
}, [inputs, setInputs])
}, [id, inputs, setInputs, updateNodeInternals])
const handleAddCondition = useCallback<HandleAddCondition>((caseId, valueSelector, varItem) => {
const newInputs = produce(inputs, (draft) => {

View File

@@ -1,5 +1,3 @@
import type { QuestionClassifierNodeType } from './types'
export const checkNodeValid = (payload: QuestionClassifierNodeType) => {
export const checkNodeValid = () => {
return true
}

View File

@@ -34,7 +34,7 @@ export const NoteEditorContextProvider = memo(({
try {
initialValue = JSON.parse(value)
}
catch (e) {
catch {
}

View File

@@ -68,7 +68,7 @@ const ChatRecord = () => {
setChatItemTree(tree)
setThreadChatItems(getThreadMessages(tree, newAllChatItems.at(-1)?.id))
}
catch (e) {
catch {
}
finally {
setFetched(true)

View File

@@ -178,7 +178,7 @@ const ChatVariableModal = ({
})
setObjectValue(newObjectValue)
}
catch (e) {
catch {
// ignore JSON.parse errors
}
}
@@ -209,7 +209,7 @@ const ChatVariableModal = ({
const newValue = JSON.parse(content)
setValue(newValue)
}
catch (e) {
catch {
// ignore JSON.parse errors
}
}

View File

@@ -3,7 +3,6 @@ import {
} from 'react'
import { RiCloseLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import type { GlobalVariable } from '../../types'
import Item from './item'
import { useStore } from '@/app/components/workflow/store'
@@ -11,7 +10,6 @@ import { useStore } from '@/app/components/workflow/store'
import cn from '@/utils/classnames'
const Panel = () => {
const { t } = useTranslation()
const setShowPanel = useStore(s => s.setShowGlobalVariablePanel)
const globalVariableList: GlobalVariable[] = [