mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 20:17:29 +08:00
fix: installed not clear countdown
This commit is contained in:
parent
41b720502f
commit
018e32e355
@ -44,7 +44,12 @@ const InstallFromMarketplace: React.FC<InstallFromMarketplaceProps> = ({
|
|||||||
countDownFoldIntoAnim,
|
countDownFoldIntoAnim,
|
||||||
} = useFoldAnimInto(onClose)
|
} = useFoldAnimInto(onClose)
|
||||||
|
|
||||||
const [isInstalling, setIsInstalling] = useState(false)
|
const [isInstalling, doSetIsInstalling] = useState(false)
|
||||||
|
const setIsInstalling = useCallback((isInstalling: boolean) => {
|
||||||
|
if (!isInstalling)
|
||||||
|
clearCountDown()
|
||||||
|
doSetIsInstalling(isInstalling)
|
||||||
|
}, [clearCountDown])
|
||||||
|
|
||||||
const foldAnimInto = useCallback(() => {
|
const foldAnimInto = useCallback(() => {
|
||||||
if (isInstalling) {
|
if (isInstalling) {
|
||||||
@ -57,7 +62,7 @@ const InstallFromMarketplace: React.FC<InstallFromMarketplaceProps> = ({
|
|||||||
const handleStartToInstall = useCallback(() => {
|
const handleStartToInstall = useCallback(() => {
|
||||||
setIsInstalling(true)
|
setIsInstalling(true)
|
||||||
countDownFoldIntoAnim()
|
countDownFoldIntoAnim()
|
||||||
}, [countDownFoldIntoAnim])
|
}, [countDownFoldIntoAnim, setIsInstalling])
|
||||||
|
|
||||||
const getTitle = useCallback(() => {
|
const getTitle = useCallback(() => {
|
||||||
if (isBundle && step === InstallStep.installed)
|
if (isBundle && step === InstallStep.installed)
|
||||||
@ -73,14 +78,14 @@ const InstallFromMarketplace: React.FC<InstallFromMarketplaceProps> = ({
|
|||||||
setStep(InstallStep.installed)
|
setStep(InstallStep.installed)
|
||||||
refreshPluginList(manifest)
|
refreshPluginList(manifest)
|
||||||
setIsInstalling(false)
|
setIsInstalling(false)
|
||||||
}, [manifest, refreshPluginList])
|
}, [manifest, refreshPluginList, setIsInstalling])
|
||||||
|
|
||||||
const handleFailed = useCallback((errorMsg?: string) => {
|
const handleFailed = useCallback((errorMsg?: string) => {
|
||||||
setStep(InstallStep.installFailed)
|
setStep(InstallStep.installFailed)
|
||||||
setIsInstalling(false)
|
setIsInstalling(false)
|
||||||
if (errorMsg)
|
if (errorMsg)
|
||||||
setErrorMsg(errorMsg)
|
setErrorMsg(errorMsg)
|
||||||
}, [])
|
}, [setIsInstalling])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user