mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-20 16:25:26 +02:00
bugfixes
This commit is contained in:
parent
f4f8eceabe
commit
95189474a4
@ -1,5 +1,5 @@
|
|||||||
import {ReactElement, useState} from "react"
|
import {ReactElement, useState} from "react"
|
||||||
import {useNavigate} from "react-router-dom"
|
import {useLocation, useNavigate} from "react-router-dom"
|
||||||
|
|
||||||
import {MultiStepForm} from "~/components"
|
import {MultiStepForm} from "~/components"
|
||||||
import GenerateEmailReportsForm from "~/route-widgets/CompleteAccountRoute/GenerateEmailReportsForm"
|
import GenerateEmailReportsForm from "~/route-widgets/CompleteAccountRoute/GenerateEmailReportsForm"
|
||||||
@ -7,9 +7,15 @@ import PasswordForm from "~/route-widgets/CompleteAccountRoute/PasswordForm"
|
|||||||
|
|
||||||
export default function CompleteAccountRoute(): ReactElement {
|
export default function CompleteAccountRoute(): ReactElement {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
const location = useLocation()
|
||||||
|
|
||||||
const [showGenerationReportForm, setShowGenerationReportForm] =
|
// If query `setup` is `true`, skip directly to the setup
|
||||||
useState(false)
|
const [showGenerationReportForm, setShowGenerationReportForm] = useState(
|
||||||
|
() => {
|
||||||
|
const searchParams = new URLSearchParams(location.search)
|
||||||
|
return searchParams.get("setup") === "true"
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MultiStepForm
|
<MultiStepForm
|
||||||
|
@ -41,7 +41,7 @@ export default function EnterDecryptionPassword(): ReactElement {
|
|||||||
} else {
|
} else {
|
||||||
const nextUrl =
|
const nextUrl =
|
||||||
new URLSearchParams(location.search).get("next") || "/"
|
new URLSearchParams(location.search).get("next") || "/"
|
||||||
navigate(nextUrl)
|
setTimeout(() => navigate(nextUrl), 0)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user