mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 10:56:52 +08:00
Chore/cleanup warnings (#17974)
This commit is contained in:
@@ -33,7 +33,7 @@ export class AudioPlayerManager {
|
||||
this.audioPlayers.cacheBuffers = []
|
||||
this.audioPlayers.sourceBuffer?.abort()
|
||||
}
|
||||
catch (e) {
|
||||
catch {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ export default class AudioPlayer {
|
||||
this.receiveAudioData(value)
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
catch {
|
||||
this.isLoadData = false
|
||||
this.callback && this.callback('error')
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ const AudioPlayer: React.FC<AudioPlayerProps> = ({ src }) => {
|
||||
setWaveformData(normalizedWaveform)
|
||||
setIsAudioAvailable(true)
|
||||
}
|
||||
catch (error) {
|
||||
catch {
|
||||
const waveform: number[] = []
|
||||
let prevValue = Math.random()
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ function getValue(value: string, isValueArray: boolean, index: number) {
|
||||
try {
|
||||
return JSON.parse(value)[index]
|
||||
}
|
||||
catch (e) {
|
||||
catch {
|
||||
}
|
||||
}
|
||||
return value
|
||||
@@ -29,7 +29,7 @@ const Thought: FC<IThoughtProps> = ({
|
||||
if (Array.isArray(JSON.parse(thought.tool)))
|
||||
return [JSON.parse(thought.tool), true]
|
||||
}
|
||||
catch (e) {
|
||||
catch {
|
||||
}
|
||||
return [[thought.tool], false]
|
||||
})()
|
||||
|
||||
@@ -138,16 +138,7 @@ const ChatWrapper = () => {
|
||||
isPublicAPI: !isInstalledApp,
|
||||
},
|
||||
)
|
||||
}, [
|
||||
chatList,
|
||||
handleNewConversationCompleted,
|
||||
handleSend,
|
||||
currentConversationId,
|
||||
currentConversationItem,
|
||||
newConversationInputs,
|
||||
isInstalledApp,
|
||||
appId,
|
||||
])
|
||||
}, [currentConversationId, currentConversationInputs, newConversationInputs, chatList, handleSend, isInstalledApp, appId, handleNewConversationCompleted])
|
||||
|
||||
const doRegenerate = useCallback((chatItem: ChatItemInTree) => {
|
||||
const question = chatList.find(item => item.id === chatItem.parentMessageId)!
|
||||
|
||||
@@ -24,7 +24,6 @@ const InputsFormContent = ({ showTip }: Props) => {
|
||||
handleNewConversationInputsChange,
|
||||
} = useEmbeddedChatbotContext()
|
||||
const inputsFormValue = currentConversationId ? currentConversationInputs : newConversationInputs
|
||||
const readonly = !!currentConversationId
|
||||
|
||||
const handleFormChange = useCallback((variable: string, value: any) => {
|
||||
setCurrentConversationInputs({
|
||||
|
||||
@@ -128,7 +128,7 @@ const CodeBlock: any = memo(({ inline, className, children, ...props }: any) =>
|
||||
try {
|
||||
return JSON.parse(String(children).replace(/\n$/, ''))
|
||||
}
|
||||
catch (error) { }
|
||||
catch { }
|
||||
}
|
||||
return JSON.parse('{"title":{"text":"ECharts error - Wrong JSON format."}}')
|
||||
}, [language, children])
|
||||
|
||||
@@ -51,7 +51,7 @@ export const SVGRenderer = ({ content }: { content: string }) => {
|
||||
setImagePreview(svgToDataURL(svgElement as Element))
|
||||
})
|
||||
}
|
||||
catch (error) {
|
||||
catch {
|
||||
if (svgRef.current)
|
||||
svgRef.current.innerHTML = '<span style="padding: 1rem;">Error rendering SVG. Wait for the image content to complete.</span>'
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ const TagManagementModal = ({ show, type }: TagManagementModalProps) => {
|
||||
setName('')
|
||||
setPending(false)
|
||||
}
|
||||
catch (e: any) {
|
||||
catch {
|
||||
notify({ type: 'error', message: t('common.tag.failed') })
|
||||
setPending(false)
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ const Panel = (props: PanelProps) => {
|
||||
setCreating(false)
|
||||
onCreate()
|
||||
}
|
||||
catch (e: any) {
|
||||
catch {
|
||||
notify({ type: 'error', message: t('common.tag.failed') })
|
||||
setCreating(false)
|
||||
}
|
||||
@@ -83,7 +83,7 @@ const Panel = (props: PanelProps) => {
|
||||
await bindTag(tagIDs, targetID, type)
|
||||
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
|
||||
}
|
||||
catch (e: any) {
|
||||
catch {
|
||||
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ const Panel = (props: PanelProps) => {
|
||||
await unBindTag(tagID, targetID, type)
|
||||
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
|
||||
}
|
||||
catch (e: any) {
|
||||
catch {
|
||||
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ const TagItemEditor: FC<TagItemEditorProps> = ({
|
||||
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
|
||||
setName(name)
|
||||
}
|
||||
catch (e: any) {
|
||||
catch {
|
||||
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
|
||||
setName(tag.name)
|
||||
const recoverList = tagList.map((tag) => {
|
||||
@@ -92,7 +92,7 @@ const TagItemEditor: FC<TagItemEditorProps> = ({
|
||||
])
|
||||
setPending(false)
|
||||
}
|
||||
catch (e: any) {
|
||||
catch {
|
||||
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
|
||||
setPending(false)
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ const VoiceInput = ({
|
||||
onConverted(audioResponse.text)
|
||||
onCancel()
|
||||
}
|
||||
catch (e) {
|
||||
catch {
|
||||
onConverted('')
|
||||
onCancel()
|
||||
}
|
||||
@@ -125,7 +125,7 @@ const VoiceInput = ({
|
||||
if (canvasRef.current && ctxRef.current)
|
||||
drawRecord()
|
||||
}
|
||||
catch (e) {
|
||||
catch {
|
||||
onCancel()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user