Skip to content

Commit

Permalink
fix(setup): use location info from router instead of browser
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Oct 8, 2023
1 parent d0f850d commit 7ecc51c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/Setup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createForm } from '@felte/solid'
import { validator } from '@felte/validator-zod'
import { useNavigate } from '@solidjs/router'
import { useLocation, useNavigate } from '@solidjs/router'
import { IconX } from '@tabler/icons-solidjs'
import ky from 'ky'
import { For, onMount } from 'solid-js'
Expand All @@ -18,12 +18,13 @@ import {
} from '~/signals'

const schema = z.object({
url: z.string().nonempty(),
url: z.string().min(1),
secret: z.string(),
})

export default () => {
const [t] = useI18n()
const location = useLocation()
const navigate = useNavigate()

const onSetupSuccess = (id: string) => {
Expand Down Expand Up @@ -109,7 +110,7 @@ export default () => {
}

onMount(() => {
const query = new URLSearchParams(window.location.search)
const query = new URLSearchParams(location.search)

if (query.has('hostname')) {
void onSubmit({
Expand Down

0 comments on commit 7ecc51c

Please sign in to comment.