Merge branch 'staging' of gitea.pena:PenaSide/front-hub into staging
Some checks failed
Deploy / DeployService (push) Has been cancelled
Deploy / CreateImage (push) Has been cancelled

This commit is contained in:
Nastya 2025-06-09 23:31:08 +03:00
commit c486780fea
2 changed files with 8 additions and 4 deletions

@ -1,4 +1,4 @@
FROM gitea.pena/penadevops/container-images/node:v20.14.0 as build FROM gitea.pena/penadevops/container-images/node:main as build
RUN apk update && rm -rf /var/cache/apk/* RUN apk update && rm -rf /var/cache/apk/*
WORKDIR /usr/app WORKDIR /usr/app

@ -19,13 +19,14 @@ import {
import { logout } from "@root/api/auth"; import { logout } from "@root/api/auth";
import { clearCustomTariffs } from "@root/stores/customTariffs"; import { clearCustomTariffs } from "@root/stores/customTariffs";
import { clearTickets } from "@root/stores/tickets"; import { clearTickets } from "@root/stores/tickets";
import {setNotEnoughMoneyAmount} from "@stores/cart" import { setNotEnoughMoneyAmount } from "@stores/cart"
const params = new URLSearchParams(window.location.search); const params = new URLSearchParams(window.location.search);
const action = params.get("action"); const action = params.get("action");
const dif = params.get("dif"); const dif = params.get("dif");
const token = params.get("data"); const token = params.get("data");
const userId = params.get("userid"); const userId = params.get("userid");
const wayback = params.get("wayback");
let first = true; let first = true;
@ -36,10 +37,13 @@ export default function QuizPayment() {
useEffect( useEffect(
function redirectIfSignedIn() { function redirectIfSignedIn() {
if (!first && user?._id === userId) if (!first && user?._id === userId) {
navigate(`/payment?action=${action}&dif=${dif}&user=${userId}`, { let returnUrl = `/payment?action=${action}&dif=${dif}&user=${userId}`
if (wayback) returnUrl += `&wayback=${wayback}`
navigate(returnUrl, {
replace: true, replace: true,
}); });
}
}, },
[navigate, user] [navigate, user]
); );