Skip to content

Commit a818130

Browse files
committed
fix: used router to navigate
1 parent 2df6c37 commit a818130

File tree

1 file changed

+3
-1
lines changed
  • src/apps/copilots/src/pages/copilot-request-form

1 file changed

+3
-1
lines changed

src/apps/copilots/src/pages/copilot-request-form/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { FC, useContext, useMemo, useState } from 'react'
22
import { bind, debounce, isEmpty } from 'lodash'
33
import { toast } from 'react-toastify'
44
import classNames from 'classnames'
5+
import { useNavigate } from "react-router-dom"
56

67
import { profileContext, ProfileContextData } from '~/libs/core'
78
import { Button, IconSolid, InputDatePicker, InputMultiselectOption,
@@ -17,6 +18,7 @@ import styles from './styles.module.scss'
1718
// eslint-disable-next-line
1819
const CopilotRequestForm: FC<{}> = () => {
1920
const { profile }: ProfileContextData = useContext(profileContext)
21+
const navigate = useNavigate();
2022

2123
const [formValues, setFormValues] = useState<any>({})
2224
const [isFormChanged, setIsFormChanged] = useState(false)
@@ -220,7 +222,7 @@ const CopilotRequestForm: FC<{}> = () => {
220222
setPaymentType('')
221223
// Added a small timeout for the toast to be visible properly to the users
222224
setTimeout(() => {
223-
window.location.href = `https://copilots.${EnvironmentConfig.TC_DOMAIN}/requests`
225+
navigate("/requests")
224226
}, 1000)
225227
})
226228
.catch(e => {

0 commit comments

Comments
 (0)