Fix(Tool): Fix the bug that can not load when switch between two tools

Fix the bug that can not load when switch between two tools. Optimize navigate when can not find tool.
This commit is contained in:
2024-04-30 13:39:25 +08:00
parent 340a842b4c
commit 843f47346a
4 changed files with 9 additions and 19 deletions

View File

@@ -62,9 +62,7 @@ const Code = () => {
break
case DATABASE_NO_RECORD_FOUND:
void message.error('未找到指定工具')
setTimeout(() => {
navigateToRepository(navigate)
}, 3000)
navigateToRepository(navigate)
break
default:
void message.error('获取工具信息失败,请稍后重试')
@@ -78,7 +76,7 @@ const Code = () => {
useEffect(() => {
getTool()
}, [])
}, [id])
return (
<>

View File

@@ -51,9 +51,7 @@ const Execute = () => {
break
case DATABASE_NO_RECORD_FOUND:
void message.error('未找到指定工具')
setTimeout(() => {
navigateToTools(navigate)
}, 3000)
navigateToTools(navigate)
break
default:
void message.error('获取工具信息失败,请稍后重试')
@@ -67,7 +65,7 @@ const Execute = () => {
useEffect(() => {
getTool()
}, [])
}, [id])
return (
<FitFullscreen data-component={'system-tools-execute'}>