Skip to content

Commit

Permalink
fix: support sing-box (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
PuerNya committed Aug 30, 2023
1 parent 12e8c9a commit 4eeb345
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/pages/Setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ export default () => {
const { form } = createForm<z.infer<typeof schema>>({
extend: validator({ schema }),
async onSubmit(values) {
const { hello } = await ky
.get(values.url, {
headers: values.secret
? {
Authorization: `Bearer ${values.secret}`,
}
: {},
})
.json<{ hello: string }>()
const { ok } = await ky.get(values.url, {
headers: values.secret
? {
Authorization: `Bearer ${values.secret}`,
}
: {},
})

if (!hello) {
if (!ok) {
return
}

Expand Down

0 comments on commit 4eeb345

Please sign in to comment.