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:
@@ -62,9 +62,7 @@ const Code = () => {
|
||||
break
|
||||
case DATABASE_NO_RECORD_FOUND:
|
||||
void message.error('未找到指定工具')
|
||||
setTimeout(() => {
|
||||
navigateToRepository(navigate)
|
||||
}, 3000)
|
||||
break
|
||||
default:
|
||||
void message.error('获取工具信息失败,请稍后重试')
|
||||
@@ -78,7 +76,7 @@ const Code = () => {
|
||||
|
||||
useEffect(() => {
|
||||
getTool()
|
||||
}, [])
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -51,9 +51,7 @@ const Execute = () => {
|
||||
break
|
||||
case DATABASE_NO_RECORD_FOUND:
|
||||
void message.error('未找到指定工具')
|
||||
setTimeout(() => {
|
||||
navigateToTools(navigate)
|
||||
}, 3000)
|
||||
break
|
||||
default:
|
||||
void message.error('获取工具信息失败,请稍后重试')
|
||||
@@ -67,7 +65,7 @@ const Execute = () => {
|
||||
|
||||
useEffect(() => {
|
||||
getTool()
|
||||
}, [])
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<FitFullscreen data-component={'system-tools-execute'}>
|
||||
|
||||
@@ -258,9 +258,7 @@ const Edit = () => {
|
||||
break
|
||||
case DATABASE_NO_RECORD_FOUND:
|
||||
void message.error('未找到指定工具')
|
||||
setTimeout(() => {
|
||||
navigateToRepository(navigate)
|
||||
}, 3000)
|
||||
break
|
||||
default:
|
||||
void message.error('获取工具信息失败,请稍后重试')
|
||||
@@ -327,7 +325,7 @@ const Edit = () => {
|
||||
return
|
||||
}
|
||||
getTool()
|
||||
}, [])
|
||||
}, [toolId, searchParams])
|
||||
|
||||
const drawerToolbar = (
|
||||
<AntdSpace>
|
||||
|
||||
@@ -49,9 +49,7 @@ const Source = () => {
|
||||
break
|
||||
case DATABASE_NO_RECORD_FOUND:
|
||||
void message.error('未找到指定工具')
|
||||
setTimeout(() => {
|
||||
navigateToRepository(navigate)
|
||||
}, 3000)
|
||||
break
|
||||
default:
|
||||
void message.error('获取工具信息失败,请稍后重试')
|
||||
@@ -70,9 +68,7 @@ const Source = () => {
|
||||
return
|
||||
}
|
||||
if (username === '!' && !getLoginStatus()) {
|
||||
setTimeout(() => {
|
||||
navigateToRepository(navigate)
|
||||
}, 3000)
|
||||
return
|
||||
}
|
||||
if (username !== '!' && ver) {
|
||||
@@ -84,7 +80,7 @@ const Source = () => {
|
||||
return
|
||||
}
|
||||
getTool()
|
||||
}, [])
|
||||
}, [username, toolId, ver, searchParams])
|
||||
|
||||
return (
|
||||
<FitFullscreen data-component={'tools-source'}>
|
||||
|
||||
Reference in New Issue
Block a user