Merge branch 'dev' into 'staging'

переход на оплату с квиза только при работе компонента, а не его подгрузке

See merge request frontend/marketplace!111
This commit is contained in:
Nastya 2024-01-29 09:10:40 +00:00
commit 72599a0270
2 changed files with 4 additions and 3 deletions

@ -71,6 +71,7 @@ const App = () => {
},
})
console.log(location)
if (location.state?.redirectTo)
return <Navigate to={location.state.redirectTo} replace state={{ backgroundLocation: location }} />
@ -83,7 +84,6 @@ const App = () => {
<Route path="/recover" element={<RecoverDialog />} />
<Route path="/changepwd" element={<RecoverPassword />} />
<Route path="/changepwd/expired" element={<OutdatedLink />} />
</Routes>
)}
<Routes location={location.state?.backgroundLocation || location}>
@ -93,7 +93,7 @@ const App = () => {
<Route path="/recover" element={<Navigate to="/" replace state={{ redirectTo: "/recover" }} />} />
<Route path="/changepwd" element={<Navigate to="/" replace state={{ redirectTo: window.location.pathname + window.location.search }} />} />
<Route path="/changepwd/expired" element={<Navigate to="/" replace state={{ redirectTo: "/changepwd/expired" }} />} />
<Route path="/quizpayment" element={<QuizPayment/>} />
<Route element={<PrivateRoute />}>
<Route element={<ProtectedLayout />}>
<Route path="/tariffs" element={<Tariffs />} />
@ -112,6 +112,7 @@ const App = () => {
</Route>
</Route>
<Route path="/ppdd" element={<PPofData/>}/>
<Route path="/quizpayment" element={<QuizPayment/>} />
<Route element={<Docs />}>
<Route path={"/docs/oferta"} element={<Oferta />}/>
<Route path={"/docs/privacy"} element={<PrivacyPolicy />}/>

@ -22,7 +22,6 @@ const dif = params.get("dif")
const token = params.get("data")
const userId = params.get("userid")
history.pushState(null, document.title, "/quizpayment");
let first = true
@ -33,6 +32,7 @@ export default function QuizPayment() {
console.log("Я начал работать")
if (first) {
history.pushState(null, document.title, "/quizpayment");
try {
first = false
if (action && dif && token) {