Skip to content

Commit

Permalink
Fix the issue where TextGeneration component does not correctly cle…
Browse files Browse the repository at this point in the history
…ar input data. (#12351)
  • Loading branch information
Woo0ood authored Jan 4, 2025
1 parent b8ba39d commit 682ebc5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/app/components/share/text-generation/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React, { useEffect, useRef, useState } from 'react'
import React, { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
RiErrorWarningFill,
Expand Down Expand Up @@ -93,8 +93,12 @@ const TextGeneration: FC<IMainProps> = ({
// Notice this situation isCallBatchAPI but not in batch tab
const [isCallBatchAPI, setIsCallBatchAPI] = useState(false)
const isInBatchTab = currentTab === 'batch'
const [inputs, setInputs] = useState<Record<string, any>>({})
const [inputs, doSetInputs] = useState<Record<string, any>>({})
const inputsRef = useRef(inputs)
const setInputs = useCallback((newInputs: Record<string, any>) => {
doSetInputs(newInputs)
inputsRef.current = newInputs
}, [])
const [appId, setAppId] = useState<string>('')
const [siteInfo, setSiteInfo] = useState<SiteInfo | null>(null)
const [canReplaceLogo, setCanReplaceLogo] = useState<boolean>(false)
Expand Down

0 comments on commit 682ebc5

Please sign in to comment.