delete console.log
This commit is contained in:
parent
bb3844c412
commit
e665ff6c4a
@ -40,7 +40,6 @@ const Answer = ({ title, percent, highlight }: AnswerProps) => {
|
||||
const theme = useTheme();
|
||||
const parsedTitle = parseTitle(title);
|
||||
|
||||
console.log("parsedTitle: " + parsedTitle);
|
||||
return (
|
||||
<Box sx={{ padding: "15px 25px" }}>
|
||||
<Box
|
||||
|
||||
@ -19,25 +19,19 @@ export const parseTitle = (title: string): string => {
|
||||
try {
|
||||
// Пытаемся распарсить как JSON
|
||||
const parsed = JSON.parse(cleanTitle);
|
||||
console.log("parsed object:", parsed);
|
||||
console.log("parsed.Image:", parsed.Image);
|
||||
console.log("parsed.Description:", parsed.Description);
|
||||
|
||||
// Проверяем, что это объект с полями Image и Description (специфичный для вопросов типа images и varimg)
|
||||
if (parsed &&
|
||||
typeof parsed === 'object' &&
|
||||
'Image' in parsed &&
|
||||
'Description' in parsed) {
|
||||
console.log("Returning Description:", parsed.Description);
|
||||
return parsed.Description || "нет названия";
|
||||
}
|
||||
|
||||
// Если это не объект с Image и Description, возвращаем исходную строку
|
||||
console.log("Not Image/Description object, returning original title");
|
||||
return title;
|
||||
} catch (error) {
|
||||
// Если парсинг не удался, возвращаем исходную строку
|
||||
console.log("JSON parse error, returning original title");
|
||||
return title;
|
||||
}
|
||||
};
|
||||
@ -36,7 +36,6 @@ export const PostbackModal: FC<PostbackModalProps> = ({
|
||||
// 1) Асинхронно получаем текущие цели
|
||||
const [items] = await getLeadTargetsByQuiz(quiz.backendId);
|
||||
const existing = (items ?? []).filter((t) => t.type === "webhook");
|
||||
console.log("Saving flow -> existing webhook targets:", existing);
|
||||
if (!tokenValue && !target) {
|
||||
const deletePromises = existing.map((t) => deleteLeadTarget(t.id));
|
||||
await Promise.all(deletePromises);
|
||||
@ -75,7 +74,6 @@ export const PostbackModal: FC<PostbackModalProps> = ({
|
||||
|
||||
useEffect(() => {
|
||||
formik.setFieldValue("domain", postbackTarget?.target ?? "");
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [postbackTarget?.target]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -35,7 +35,6 @@ export const ZapierModal: FC<ZapierModalProps> = ({
|
||||
// 1) Асинхронно получаем текущие цели
|
||||
const [items] = await getLeadTargetsByQuiz(quiz.backendId);
|
||||
const existing = (items ?? []).filter((t) => t.type === "webhook");
|
||||
console.log("Saving flow -> existing webhook targets:", existing);
|
||||
|
||||
if (!target) {
|
||||
// Пустое значение — удаляем все
|
||||
@ -77,7 +76,6 @@ export const ZapierModal: FC<ZapierModalProps> = ({
|
||||
|
||||
useEffect(() => {
|
||||
formik.setFieldValue("webhookUrl", zapierTarget?.target ?? "");
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [zapierTarget?.target]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -45,13 +45,10 @@ export const IntegrationsPage = ({
|
||||
if (!leadTargetsLoaded && quiz?.id) {
|
||||
const [items] = await getLeadTargetsByQuiz(quiz.backendId);
|
||||
const list = items ?? [];
|
||||
console.log("LeadTargets fetched:", list);
|
||||
setLeadTargets(list);
|
||||
const webhookOnly = list.filter((t) => t.type === "webhook");
|
||||
console.log("Webhook-only targets:", webhookOnly);
|
||||
const zapier = webhookOnly.find((t) => (t.target || "").toLowerCase().includes("zapier")) ?? null;
|
||||
const postback = webhookOnly.find((t) => (t.target || "").toLowerCase().includes("postback")) ?? null;
|
||||
console.log("Distributed targets:", { zapier, postback });
|
||||
setZapierTarget(zapier);
|
||||
setPostbackTarget(postback);
|
||||
setLeadTargetsLoaded(true);
|
||||
|
||||
@ -19,12 +19,9 @@ export function useLeadTargets(quizBackendId: number | undefined, isOpen: boolea
|
||||
try {
|
||||
const [items] = await getLeadTargetsByQuiz(quizBackendId);
|
||||
const list = items ?? [];
|
||||
console.log("LeadTargets fetched:", list);
|
||||
const webhookOnly = list.filter((t) => t.type === "webhook");
|
||||
console.log("Webhook-only targets:", webhookOnly);
|
||||
const zapier = webhookOnly.find((t) => (t.target || "").toLowerCase().includes("zapier")) ?? null;
|
||||
const postback = webhookOnly.find((t) => (t.target || "").toLowerCase().includes("postback")) ?? null;
|
||||
console.log("Distributed targets:", { zapier, postback });
|
||||
setZapierTarget(zapier);
|
||||
setPostbackTarget(postback);
|
||||
} finally {
|
||||
|
||||
@ -2,7 +2,6 @@ import React from "react";
|
||||
import Box from "@mui/material/Box";
|
||||
import Button from "@mui/material/Button";
|
||||
import SectionStyled from "./SectionStyled";
|
||||
import NavMenuItem from "@ui_kit/Header/NavMenuItem";
|
||||
import QuizLogo from "./images/icons/QuizLogo";
|
||||
import { useMediaQuery, useTheme } from "@mui/material";
|
||||
import { setIsContactFormOpen } from "../../stores/contactForm";
|
||||
@ -26,12 +25,6 @@ export default function Component() {
|
||||
const userId = useUserStore((state) => state.userId);
|
||||
const location = useLocation();
|
||||
|
||||
console.log("HeaderLanding debug:", {
|
||||
userId,
|
||||
location: location.pathname,
|
||||
backgroundLocation: location.state?.backgroundLocation
|
||||
});
|
||||
|
||||
return (
|
||||
<SectionStyled
|
||||
tag={"header"}
|
||||
|
||||
@ -55,7 +55,6 @@ export default function RecoverPassword() {
|
||||
initialValues,
|
||||
validationSchema,
|
||||
onSubmit: async (values, formikHelpers) => {
|
||||
console.log("tokenUser", tokenUser);
|
||||
|
||||
if (tokenUser) {
|
||||
setAuthToken(tokenUser || "");
|
||||
@ -77,11 +76,8 @@ export default function RecoverPassword() {
|
||||
},
|
||||
});
|
||||
useEffect(() => {
|
||||
console.log("RecoverPassword useEffect - window.location.search:", window.location.search);
|
||||
console.log("RecoverPassword useEffect - window.location.href:", window.location.href);
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const authToken = params.get("auth");
|
||||
console.log("RecoverPassword useEffect - authToken:", authToken);
|
||||
setTokenUser(authToken || "");
|
||||
|
||||
history.pushState(null, document.title, "/changepwd");
|
||||
|
||||
@ -67,16 +67,12 @@ export const setUser = (user: User) =>
|
||||
);
|
||||
|
||||
export const clearUserData = () => {
|
||||
console.log("clearUserData: Clearing user data");
|
||||
console.log("clearUserData: Before clearing -", useUserStore.getState());
|
||||
|
||||
useUserStore.setState({ ...initialState });
|
||||
|
||||
console.log("clearUserData: After clearing -", useUserStore.getState());
|
||||
|
||||
// Также очищаем localStorage напрямую
|
||||
localStorage.removeItem("user");
|
||||
console.log("clearUserData: localStorage cleared");
|
||||
};
|
||||
|
||||
export const setUserAccount = (userAccount: OriginalUserAccount) =>
|
||||
|
||||
@ -6,26 +6,15 @@ export default function PrivateRoute() {
|
||||
const user = useUserStore((state) => state.user);
|
||||
const userId = useUserStore((state) => state.userId);
|
||||
|
||||
console.log("PrivateRoute debug:", {
|
||||
user: user ? "exists" : "null",
|
||||
userId: user?._id,
|
||||
userIdFromStore: userId,
|
||||
currentPath: window.location.pathname,
|
||||
userObject: user
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!user) {
|
||||
console.log("PrivateRoute: User is null, redirecting to / via useEffect");
|
||||
window.location.href = "/";
|
||||
}
|
||||
}, [user]);
|
||||
|
||||
if (!user) {
|
||||
console.log("PrivateRoute: User is null, showing fallback");
|
||||
return <></>;
|
||||
}
|
||||
|
||||
console.log("PrivateRoute: User exists, rendering Outlet");
|
||||
return <Outlet />;
|
||||
}
|
||||
|
||||
@ -17,8 +17,6 @@ export const generateHubWalletRequestURL = ({
|
||||
}) => {
|
||||
let currentDomain = window.location.host;
|
||||
if (currentDomain === "localhost") currentDomain += ":3000";
|
||||
|
||||
console.log("Я здесь для отладки и спешу сообщить, что деплой был успешно завершен!")
|
||||
|
||||
// Используем более надежный способ генерации URL
|
||||
const baseUrl = `http://${isTestServer ? "s" : ""}hub.pena.digital/anyservicepayment`;
|
||||
|
||||
@ -25,10 +25,8 @@ export function handleComponentError(error: Error, info: ErrorInfo, getTickets:
|
||||
if (!getAuthToken()) return;
|
||||
// Проверяем разрешение на отправку ошибок (по домену)
|
||||
if (!isErrorReportingAllowed(error)) {
|
||||
console.log('❌ Отправка ошибки заблокирована:', error.message);
|
||||
return;
|
||||
}
|
||||
console.log(`✅ Обработка ошибки: ${error.message}`);
|
||||
// Копируем __forceSend если есть
|
||||
const componentError: ComponentError & { __forceSend?: boolean } = {
|
||||
timestamp: Math.floor(Date.now() / 1000),
|
||||
@ -56,7 +54,6 @@ export async function sendErrorsToServer(getTickets: () => Ticket[]) {
|
||||
// Если хотя бы одна ошибка в очереди с __forceSend, отправляем всё
|
||||
const forceSend = errorsQueue.some(e => (e as any).__forceSend);
|
||||
if (!forceSend && !isErrorReportingAllowed()) {
|
||||
console.log('❌ Отправка ошибок заблокирована, очищаем очередь');
|
||||
errorsQueue = [];
|
||||
return;
|
||||
}
|
||||
@ -93,10 +90,8 @@ export async function sendErrorsToServer(getTickets: () => Ticket[]) {
|
||||
// Ищет существующий тикет с system: true
|
||||
export async function findSystemTicket(tickets: Ticket[]) {
|
||||
for (const ticket of tickets) {
|
||||
console.log("[findSystemTicket] Проверяем тикет:", ticket);
|
||||
if (!('messages' in ticket)) {
|
||||
if (ticket.top_message && ticket.top_message.system === true) {
|
||||
console.log("[findSystemTicket] Найден тикет по top_message.system:true:", ticket.id);
|
||||
return ticket.id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,21 +35,10 @@ export const useAfterPay = () => {
|
||||
// Проверяем, есть ли токен восстановления пароля в URL
|
||||
const hasAuthToken = searchParams.get("auth") || window.location.search.includes("auth=");
|
||||
|
||||
console.log("useAfterPay debug:", {
|
||||
pathname: location.pathname,
|
||||
backgroundLocation: location.state?.backgroundLocation,
|
||||
isRecoverPasswordModal,
|
||||
searchParams: window.location.search,
|
||||
authToken: searchParams.get("auth"),
|
||||
hasAuthToken
|
||||
});
|
||||
|
||||
// НЕ очищаем параметры на странице восстановления пароля, когда открыты модалки или есть токен auth
|
||||
if (location.pathname !== "/changepwd" && !location.state?.backgroundLocation && !isRecoverPasswordModal && !hasAuthToken) {
|
||||
console.log("Очищаем параметры URL");
|
||||
setSearchParams({}, { replace: true });
|
||||
} else {
|
||||
console.log("НЕ очищаем параметры URL");
|
||||
}
|
||||
|
||||
if (userId && URLuserId && userId === URLuserId) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user