mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
refactor: shorten checkEndpoint further
This commit is contained in:
parent
1cffb4b305
commit
fa167100c7
@ -21,7 +21,7 @@ export default () => {
|
|||||||
navigate('/overview')
|
navigate('/overview')
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkEndpoint = ({ url, secret }: { url: string; secret: string }) =>
|
const checkEndpoint = (url: string, secret: string) =>
|
||||||
ky
|
ky
|
||||||
.get(url, {
|
.get(url, {
|
||||||
headers: secret
|
headers: secret
|
||||||
@ -40,9 +40,7 @@ export default () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!(await checkEndpoint(endpoint.url, endpoint.secret))) {
|
||||||
!(await checkEndpoint({ url: endpoint.url, secret: endpoint.secret }))
|
|
||||||
) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +60,7 @@ export default () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(await checkEndpoint({ url, secret }))) {
|
if (!(await checkEndpoint(url, secret))) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user