чистка консольлогов
This commit is contained in:
parent
dc5e923ba6
commit
1a586dc5dc
@ -68,10 +68,8 @@ export async function recover(
|
|||||||
useToken: false,
|
useToken: false,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
});
|
});
|
||||||
console.log(recoverResponse)
|
|
||||||
return [recoverResponse];
|
return [recoverResponse];
|
||||||
} catch (nativeError) {
|
} catch (nativeError) {
|
||||||
console.log(nativeError)
|
|
||||||
const [error] = parseAxiosError(nativeError);
|
const [error] = parseAxiosError(nativeError);
|
||||||
|
|
||||||
return [null, `Не удалось восстановить пароль. ${error}`];
|
return [null, `Не удалось восстановить пароль. ${error}`];
|
||||||
|
@ -58,15 +58,13 @@ export async function getHistory(): Promise<[GetHistoryResponse | GetHistoryResp
|
|||||||
}
|
}
|
||||||
|
|
||||||
const checked = historyResponse.records.map((data) => {
|
const checked = historyResponse.records.map((data) => {
|
||||||
console.log(data.rawDetails)
|
|
||||||
const buffer:KeyValue[] = []
|
const buffer:KeyValue[] = []
|
||||||
data.rawDetails.forEach((slot) => {
|
data.rawDetails.forEach((slot) => {
|
||||||
let index = regList[slot.Key as string]
|
let index = regList[slot.Key as string]
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
buffer[index] = { Key: slot.Key, Value: slot.Value }
|
buffer[index] = { Key: slot.Key, Value: slot.Value }
|
||||||
})
|
})
|
||||||
//Чистим дыры с помощью .filter(() => true) но нужно ли это
|
//Чистим дыры с помощью .filter(() => true)
|
||||||
console.log("Я собираюсь вкладывать такой буфер равдетайлс", buffer)
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
data.rawDetails = buffer
|
data.rawDetails = buffer
|
||||||
return data
|
return data
|
||||||
|
@ -8,7 +8,6 @@ export async function getRecentlyPurchasedTariffs(): Promise<[any | null, string
|
|||||||
method: "get",
|
method: "get",
|
||||||
useToken: true,
|
useToken: true,
|
||||||
})
|
})
|
||||||
console.log(recentlyPurchased)
|
|
||||||
return [recentlyPurchased]
|
return [recentlyPurchased]
|
||||||
} catch (nativeError) {
|
} catch (nativeError) {
|
||||||
const [error] = parseAxiosError(nativeError)
|
const [error] = parseAxiosError(nativeError)
|
||||||
|
@ -7,8 +7,6 @@ import type { GetTariffsResponse } from "@root/model/tariff";
|
|||||||
import { removeTariffFromCart } from "@root/stores/user";
|
import { removeTariffFromCart } from "@root/stores/user";
|
||||||
|
|
||||||
const apiUrl = process.env.REACT_APP_DOMAIN + "/strator"
|
const apiUrl = process.env.REACT_APP_DOMAIN + "/strator"
|
||||||
console.log("домен с которого тарифы запрашиваются", process.env.REACT_APP_DOMAIN)
|
|
||||||
console.log("домен с которого тарифы запрашиваются", apiUrl)
|
|
||||||
|
|
||||||
export async function getTariffs(
|
export async function getTariffs(
|
||||||
apiPage: number,
|
apiPage: number,
|
||||||
|
@ -27,7 +27,6 @@ export async function verification(
|
|||||||
obj.url = obj.url.replace("https://hub.pena.digital", process.env.REACT_APP_DOMAIN?.toString() || "").replace("https://shub.pena.digital", process.env.REACT_APP_DOMAIN?.toString() || "")
|
obj.url = obj.url.replace("https://hub.pena.digital", process.env.REACT_APP_DOMAIN?.toString() || "").replace("https://shub.pena.digital", process.env.REACT_APP_DOMAIN?.toString() || "")
|
||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
console.log(verificationResponse)
|
|
||||||
|
|
||||||
return [verificationResponse]
|
return [verificationResponse]
|
||||||
} catch (nativeError) {
|
} catch (nativeError) {
|
||||||
@ -35,7 +34,6 @@ export async function verification(
|
|||||||
if (err.response?.status === 404) {
|
if (err.response?.status === 404) {
|
||||||
return [null, `нет данных`]
|
return [null, `нет данных`]
|
||||||
}
|
}
|
||||||
console.log(nativeError)
|
|
||||||
const [error] = parseAxiosError(nativeError)
|
const [error] = parseAxiosError(nativeError)
|
||||||
|
|
||||||
return [null, `Ошибка запроса верификации. ${error}`]
|
return [null, `Ошибка запроса верификации. ${error}`]
|
||||||
|
@ -31,7 +31,7 @@ function Drawers() {
|
|||||||
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
||||||
const [isDrawerOpen, setIsDrawerOpen] = useState<boolean>(false);
|
const [isDrawerOpen, setIsDrawerOpen] = useState<boolean>(false);
|
||||||
const cart = useCart();
|
const cart = useCart();
|
||||||
console.log("БОкОВАЯкорзина", cart.priceAfterDiscounts)
|
console.log("боковой cart", cart.priceAfterDiscounts)
|
||||||
const userAccount = useUserStore((state) => state.userAccount);
|
const userAccount = useUserStore((state) => state.userAccount);
|
||||||
const tickets = useTicketStore((state) => state.tickets);
|
const tickets = useTicketStore((state) => state.tickets);
|
||||||
const notEnoughMoneyAmount = useCartStore(state => state.notEnoughMoneyAmount);
|
const notEnoughMoneyAmount = useCartStore(state => state.notEnoughMoneyAmount);
|
||||||
|
@ -276,7 +276,6 @@ export default function Chat({ open = false, onclickArrow, sx }: Props) {
|
|||||||
const sendFile = async (file: File) => {
|
const sendFile = async (file: File) => {
|
||||||
if (file === undefined) return true;
|
if (file === undefined) return true;
|
||||||
|
|
||||||
console.log("тут ошибка", modalWarningType);
|
|
||||||
let data;
|
let data;
|
||||||
if (!ticket.sessionData?.ticketId) {
|
if (!ticket.sessionData?.ticketId) {
|
||||||
try {
|
try {
|
||||||
@ -321,7 +320,6 @@ export default function Chat({ open = false, onclickArrow, sx }: Props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sendFileHC = async (file: File) => {
|
const sendFileHC = async (file: File) => {
|
||||||
console.log(file);
|
|
||||||
const check = checkAcceptableMediaType(file);
|
const check = checkAcceptableMediaType(file);
|
||||||
if (check.length > 0) {
|
if (check.length > 0) {
|
||||||
enqueueSnackbar(check);
|
enqueueSnackbar(check);
|
||||||
@ -330,7 +328,6 @@ export default function Chat({ open = false, onclickArrow, sx }: Props) {
|
|||||||
setDisableFileButton(true);
|
setDisableFileButton(true);
|
||||||
await sendFile(file);
|
await sendFile(file);
|
||||||
setDisableFileButton(false);
|
setDisableFileButton(false);
|
||||||
console.log(disableFileButton);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -520,7 +517,6 @@ export default function Chat({ open = false, onclickArrow, sx }: Props) {
|
|||||||
<IconButton
|
<IconButton
|
||||||
disabled={disableFileButton}
|
disabled={disableFileButton}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
console.log(disableFileButton);
|
|
||||||
if (!disableFileButton) fileInputRef.current?.click();
|
if (!disableFileButton) fileInputRef.current?.click();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -25,10 +25,6 @@ export default function ChatImage({
|
|||||||
}: Props) {
|
}: Props) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
||||||
const navigate = useNavigate();
|
|
||||||
useEffect(() => {
|
|
||||||
() => console.log("delete");
|
|
||||||
});
|
|
||||||
const messageBackgroundColor = isSelf
|
const messageBackgroundColor = isSelf
|
||||||
? "white"
|
? "white"
|
||||||
: unAuthenticated
|
: unAuthenticated
|
||||||
|
@ -25,7 +25,6 @@ const Transition = forwardRef(function Transition(
|
|||||||
},
|
},
|
||||||
ref: React.Ref<unknown>
|
ref: React.Ref<unknown>
|
||||||
) {
|
) {
|
||||||
console.log(props.children);
|
|
||||||
return (
|
return (
|
||||||
<Slide direction="up" ref={ref} {...props}>
|
<Slide direction="up" ref={ref} {...props}>
|
||||||
{props.children ? (
|
{props.children ? (
|
||||||
|
@ -31,7 +31,6 @@ export default function NumberInputWithUnitAdornment({ id, value, adornmentText,
|
|||||||
id={id}
|
id={id}
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
e.target.value = String(Number(String(e.target.value).replace(/^0+(?=\d\.)/, "")))
|
e.target.value = String(Number(String(e.target.value).replace(/^0+(?=\d\.)/, "")))
|
||||||
console.log("сработало", e.target.value)
|
|
||||||
}}
|
}}
|
||||||
value={changed ? (value !== sliderSettingsByType[privilege.value]?.min ? parseInt(String(value), 10) : sliderSettingsByType[privilege.value]?.min) : ""}
|
value={changed ? (value !== sliderSettingsByType[privilege.value]?.min ? parseInt(String(value), 10) : sliderSettingsByType[privilege.value]?.min) : ""}
|
||||||
onChange={({ target }: ChangeEvent<HTMLInputElement>) => {
|
onChange={({ target }: ChangeEvent<HTMLInputElement>) => {
|
||||||
|
@ -80,7 +80,7 @@ export default function ProtectedLayout() {
|
|||||||
usePrivilegeFetcher({
|
usePrivilegeFetcher({
|
||||||
onSuccess: setPrivileges,
|
onSuccess: setPrivileges,
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
console.log("usePrivilegeFetcher error :>> ", error);
|
console.error("usePrivilegeFetcher error :>> ", error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ export default function TotalPrice({ priceAfterDiscounts, priceBeforeDiscounts,
|
|||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
console.log("TOTALPRICE", priceAfterDiscounts)
|
|
||||||
async function handlePayClick() {
|
async function handlePayClick() {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
@ -33,7 +32,6 @@ export default function TotalPrice({ priceAfterDiscounts, priceBeforeDiscounts,
|
|||||||
if (payCartError.includes("insufficient funds: ")) {
|
if (payCartError.includes("insufficient funds: ")) {
|
||||||
const notEnoughMoneyAmount = parseInt(payCartError.replace(/^.*insufficient\sfunds:\s(?=\d+$)/, ""));
|
const notEnoughMoneyAmount = parseInt(payCartError.replace(/^.*insufficient\sfunds:\s(?=\d+$)/, ""));
|
||||||
|
|
||||||
console.log(notEnoughMoneyAmount);
|
|
||||||
setNotEnoughMoneyAmount(notEnoughMoneyAmount);
|
setNotEnoughMoneyAmount(notEnoughMoneyAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,12 +63,9 @@ pdfjs.GlobalWorkerOptions.workerSrc = new URL(
|
|||||||
).toString();
|
).toString();
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
console.log("render app");
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const userId = useUserStore((state) => state.userId);
|
const userId = useUserStore((state) => state.userId);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
console.log(location.pathname === "/cart")
|
|
||||||
console.log(userId);
|
|
||||||
if(location.pathname !== "/cart"){setNotEnoughMoneyAmount(0)}
|
if(location.pathname !== "/cart"){setNotEnoughMoneyAmount(0)}
|
||||||
useUserFetcher({
|
useUserFetcher({
|
||||||
url: process.env.REACT_APP_DOMAIN + `/user/${userId}`,
|
url: process.env.REACT_APP_DOMAIN + `/user/${userId}`,
|
||||||
@ -101,7 +98,6 @@ const App = () => {
|
|||||||
|
|
||||||
verify(userId);
|
verify(userId);
|
||||||
|
|
||||||
console.log(location);
|
|
||||||
if (location.state?.redirectTo)
|
if (location.state?.redirectTo)
|
||||||
return (
|
return (
|
||||||
<Navigate
|
<Navigate
|
||||||
|
@ -51,7 +51,6 @@ function AccountSettings() {
|
|||||||
const type = onChangeTypeLP
|
const type = onChangeTypeLP
|
||||||
setOnChangeTypeLP("")
|
setOnChangeTypeLP("")
|
||||||
setReadySend(false)
|
setReadySend(false)
|
||||||
console.log(type)
|
|
||||||
if (type === "email" && user?.email !== settingsFields.email.value) setSettingsField("email", user?.email || "")
|
if (type === "email" && user?.email !== settingsFields.email.value) setSettingsField("email", user?.email || "")
|
||||||
if (type === "password") setSettingsField("password", "")
|
if (type === "password") setSettingsField("password", "")
|
||||||
if (type === "all") {
|
if (type === "all") {
|
||||||
@ -71,7 +70,6 @@ function AccountSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const trySendData = () => {
|
const trySendData = () => {
|
||||||
console.log("клик по сохранить")
|
|
||||||
if (user?.email !== settingsFields.email.value && settingsFields.password.value.length > 0) {
|
if (user?.email !== settingsFields.email.value && settingsFields.password.value.length > 0) {
|
||||||
setReadySend(true)
|
setReadySend(true)
|
||||||
setOnChangeTypeLP("all")
|
setOnChangeTypeLP("all")
|
||||||
|
@ -28,7 +28,6 @@ export default function JuridicalDocumentsDialog() {
|
|||||||
const isOpen = useUserStore((state) => state.isDocumentsDialogOpen)
|
const isOpen = useUserStore((state) => state.isDocumentsDialogOpen)
|
||||||
const verificationStatus = useUserStore((state) => state.verificationStatus)
|
const verificationStatus = useUserStore((state) => state.verificationStatus)
|
||||||
const documents = useUserStore((state) => state.documents)//загруженные юзером файлы
|
const documents = useUserStore((state) => state.documents)//загруженные юзером файлы
|
||||||
console.log(documents)
|
|
||||||
const documentsUrl = useUserStore((state) => state.documentsUrl)//ссылки с бекенда
|
const documentsUrl = useUserStore((state) => state.documentsUrl)//ссылки с бекенда
|
||||||
const userId = useUserStore((state) => state.userId) ?? ""
|
const userId = useUserStore((state) => state.userId) ?? ""
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ function Cart() {
|
|||||||
|
|
||||||
const totalPriceBeforeDiscounts = cart.priceBeforeDiscounts;
|
const totalPriceBeforeDiscounts = cart.priceBeforeDiscounts;
|
||||||
const totalPriceAfterDiscounts = cart.priceAfterDiscounts;
|
const totalPriceAfterDiscounts = cart.priceAfterDiscounts;
|
||||||
console.log("CARTcarttotalPriceAfterDiscounts ", totalPriceAfterDiscounts)
|
|
||||||
|
|
||||||
const handleCustomBackNavigation = usePrevLocation(location);
|
const handleCustomBackNavigation = usePrevLocation(location);
|
||||||
|
|
||||||
|
@ -35,11 +35,6 @@ export default function AccordionWrapper({ content, last, first, createdAt, onCl
|
|||||||
content[0].Value[0].forEach((item) => {
|
content[0].Value[0].forEach((item) => {
|
||||||
valuesByKey[item.Key] = item.Value
|
valuesByKey[item.Key] = item.Value
|
||||||
})
|
})
|
||||||
console.log("Я врапер")
|
|
||||||
console.log(content)
|
|
||||||
console.log(content[0])
|
|
||||||
console.log(content[0].Value)
|
|
||||||
console.log(valuesByKey)
|
|
||||||
const extractDateFromString = (tariffName: string) => {
|
const extractDateFromString = (tariffName: string) => {
|
||||||
const dateMatch = tariffName.match(/\d{4}-\d{2}-\d{2}/)
|
const dateMatch = tariffName.match(/\d{4}-\d{2}-\d{2}/)
|
||||||
return dateMatch ? dateMatch[0] : null
|
return dateMatch ? dateMatch[0] : null
|
||||||
|
@ -50,7 +50,6 @@ export default function History() {
|
|||||||
enqueueSnackbar("извините, произошла ошибка");
|
enqueueSnackbar("извините, произошла ошибка");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log("!!!!!!!!!!!!!!!", historyData)
|
|
||||||
return (
|
return (
|
||||||
<SectionWrapper
|
<SectionWrapper
|
||||||
maxWidth="lg"
|
maxWidth="lg"
|
||||||
|
@ -73,13 +73,11 @@ export default function Payment() {
|
|||||||
const notEnoughMoneyAmount =
|
const notEnoughMoneyAmount =
|
||||||
(location.state?.notEnoughMoneyAmount as number) ?? 0;
|
(location.state?.notEnoughMoneyAmount as number) ?? 0;
|
||||||
|
|
||||||
console.log("notEnoughMoneyAmount ", paymentValueField);
|
|
||||||
const paymentValue = parseFloat(
|
const paymentValue = parseFloat(
|
||||||
bigDecimal.multiply(parseFloat(paymentValueField), 100)
|
bigDecimal.multiply(parseFloat(paymentValueField), 100)
|
||||||
);
|
);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
console.log("notEnoughMoneyAmount ", notEnoughMoneyAmount);
|
|
||||||
setPaymentValueField((notEnoughMoneyAmount / 100).toString());
|
setPaymentValueField((notEnoughMoneyAmount / 100).toString());
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const fromSquiz = params.get("action");
|
const fromSquiz = params.get("action");
|
||||||
@ -88,7 +86,6 @@ export default function Payment() {
|
|||||||
setPaymentValueField((Number(params.get("dif") || "0") / 100).toString());
|
setPaymentValueField((Number(params.get("dif") || "0") / 100).toString());
|
||||||
}
|
}
|
||||||
history.pushState(null, document.title, "/payment");
|
history.pushState(null, document.title, "/payment");
|
||||||
console.log(fromSquiz);
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
async function handleChoosePaymentClick() {
|
async function handleChoosePaymentClick() {
|
||||||
|
@ -58,7 +58,6 @@ export default function QuizPayment() {
|
|||||||
[navigate, user]
|
[navigate, user]
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log("Я начал работать");
|
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
history.pushState(null, document.title, "/quizpayment");
|
history.pushState(null, document.title, "/quizpayment");
|
||||||
@ -71,8 +70,6 @@ export default function QuizPayment() {
|
|||||||
|
|
||||||
if (action && dif && token) {
|
if (action && dif && token) {
|
||||||
(async () => {
|
(async () => {
|
||||||
// const data = await refresh(token)
|
|
||||||
// console.log(token)
|
|
||||||
if (getAuthToken()) {
|
if (getAuthToken()) {
|
||||||
clearAuthToken();
|
clearAuthToken();
|
||||||
clearUserData();
|
clearUserData();
|
||||||
@ -85,7 +82,6 @@ export default function QuizPayment() {
|
|||||||
setAuthToken(token);
|
setAuthToken(token);
|
||||||
|
|
||||||
// setAuthToken(data.data.accessToken)
|
// setAuthToken(data.data.accessToken)
|
||||||
console.log("делаем юзера ", userId);
|
|
||||||
setUserId(userId);
|
setUserId(userId);
|
||||||
|
|
||||||
// useUserFetcher({
|
// useUserFetcher({
|
||||||
@ -107,7 +103,6 @@ export default function QuizPayment() {
|
|||||||
link.click();
|
link.click();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
|
||||||
setMessage("Произошла ошибка");
|
setMessage("Произошла ошибка");
|
||||||
var link = document.createElement("a");
|
var link = document.createElement("a");
|
||||||
link.href = "https://quiz.pena.digital/tariffs";
|
link.href = "https://quiz.pena.digital/tariffs";
|
||||||
|
@ -3,7 +3,6 @@ import { useLocation } from "react-router-dom";
|
|||||||
|
|
||||||
export default function ChatImageNewWindow() {
|
export default function ChatImageNewWindow() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
console.log(location);
|
|
||||||
const srcImage = location.pathname.split("image/")[1];
|
const srcImage = location.pathname.split("image/")[1];
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -50,7 +50,6 @@ import ChatImage from "@components/FloatingSupportChat/ChatImage";
|
|||||||
import ChatVideo from "@components/FloatingSupportChat/ChatVideo";
|
import ChatVideo from "@components/FloatingSupportChat/ChatVideo";
|
||||||
|
|
||||||
function SupportChat() {
|
function SupportChat() {
|
||||||
console.log("сапортчат отрисовался");
|
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
||||||
const isMobile = useMediaQuery(theme.breakpoints.up(460));
|
const isMobile = useMediaQuery(theme.breakpoints.up(460));
|
||||||
@ -216,7 +215,6 @@ function SupportChat() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sendFileHC = async (file: File) => {
|
const sendFileHC = async (file: File) => {
|
||||||
console.log(file);
|
|
||||||
const check = checkAcceptableMediaType(file);
|
const check = checkAcceptableMediaType(file);
|
||||||
if (check.length > 0) {
|
if (check.length > 0) {
|
||||||
enqueueSnackbar(check);
|
enqueueSnackbar(check);
|
||||||
@ -225,7 +223,6 @@ function SupportChat() {
|
|||||||
setDisableFileButton(true);
|
setDisableFileButton(true);
|
||||||
await sendFile(file);
|
await sendFile(file);
|
||||||
setDisableFileButton(false);
|
setDisableFileButton(false);
|
||||||
console.log(disableFileButton);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -426,7 +423,6 @@ function SupportChat() {
|
|||||||
sx={{ mr: "4px" }}
|
sx={{ mr: "4px" }}
|
||||||
disabled={disableFileButton}
|
disabled={disableFileButton}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
console.log(disableFileButton);
|
|
||||||
if (!disableFileButton) fileInputRef.current?.click();
|
if (!disableFileButton) fileInputRef.current?.click();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -467,7 +463,6 @@ function SupportChat() {
|
|||||||
sx={{ mr: "4px" }}
|
sx={{ mr: "4px" }}
|
||||||
disabled={disableFileButton}
|
disabled={disableFileButton}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
console.log(disableFileButton);
|
|
||||||
if (!disableFileButton) fileInputRef.current?.click();
|
if (!disableFileButton) fileInputRef.current?.click();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -182,7 +182,7 @@ export const setDocument = (type: UserDocumentTypes, file: File | null) =>
|
|||||||
|
|
||||||
imageSrc = URL.createObjectURL(file)
|
imageSrc = URL.createObjectURL(file)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error creating object url", error)
|
console.error("Error creating object url", error)
|
||||||
}
|
}
|
||||||
|
|
||||||
state.documents[type] = {
|
state.documents[type] = {
|
||||||
|
@ -17,7 +17,6 @@ export const checkAcceptableMediaType = (file: File) => {
|
|||||||
const extension = segments[segments.length - 1];
|
const extension = segments[segments.length - 1];
|
||||||
const type = extension.toLowerCase();
|
const type = extension.toLowerCase();
|
||||||
|
|
||||||
console.log(type);
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ACCEPT_SEND_MEDIA_TYPES_MAP.document.find((name) => name === type):
|
case ACCEPT_SEND_MEDIA_TYPES_MAP.document.find((name) => name === type):
|
||||||
if (file.size > MAX_FILE_SIZE) return TOO_LARGE_TEXT;
|
if (file.size > MAX_FILE_SIZE) return TOO_LARGE_TEXT;
|
||||||
|
@ -38,6 +38,5 @@ async function sendErrorsToServer() {
|
|||||||
// body: errorsQueue,
|
// body: errorsQueue,
|
||||||
// useToken: true,
|
// useToken: true,
|
||||||
// });
|
// });
|
||||||
console.log(`Fake-sending ${errorsQueue.length} errors to server`, errorsQueue)
|
|
||||||
errorsQueue = []
|
errorsQueue = []
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ export function useCart(): CartData {
|
|||||||
return calcCart(cartTariffs ?? [], discounts ?? [], purchasesAmount, userId, isUserNko);
|
return calcCart(cartTariffs ?? [], discounts ?? [], purchasesAmount, userId, isUserNko);
|
||||||
}, [cartTariffs, discounts, purchasesAmount, userId, isUserNko]);
|
}, [cartTariffs, discounts, purchasesAmount, userId, isUserNko]);
|
||||||
|
|
||||||
console.log("Тут калькулятор покалькулировал. Вот что говорит: ", cart)
|
console.log("cart ", cart)
|
||||||
|
|
||||||
return cart;
|
return cart;
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,7 @@ const translateMessage: Record<string, string> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const parseAxiosError = (nativeError: unknown): [string, number?] => {
|
export const parseAxiosError = (nativeError: unknown): [string, number?] => {
|
||||||
console.log(nativeError);
|
|
||||||
const error = nativeError as AxiosError;
|
const error = nativeError as AxiosError;
|
||||||
console.log(error);
|
|
||||||
console.log(error.response?.data);
|
|
||||||
if (error.response?.data) {
|
if (error.response?.data) {
|
||||||
const serverError = error.response.data as ServerError;
|
const serverError = error.response.data as ServerError;
|
||||||
let SEMessage;
|
let SEMessage;
|
||||||
@ -39,12 +36,10 @@ export const parseAxiosError = (nativeError: unknown): [string, number?] => {
|
|||||||
// SEMessage = serverError?.error.toLowerCase() || ""
|
// SEMessage = serverError?.error.toLowerCase() || ""
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
console.log(serverError);
|
|
||||||
const translatedMessage = translateMessage[SEMessage || ""];
|
const translatedMessage = translateMessage[SEMessage || ""];
|
||||||
if (translatedMessage !== undefined) SEMessage = translatedMessage;
|
if (translatedMessage !== undefined) SEMessage = translatedMessage;
|
||||||
return [SEMessage || "", serverError.statusCode];
|
return [SEMessage || "", serverError.statusCode];
|
||||||
}
|
}
|
||||||
console.log(error?.status);
|
|
||||||
switch (error?.status || error.response?.status) {
|
switch (error?.status || error.response?.status) {
|
||||||
case 404:
|
case 404:
|
||||||
return ["Не найдено.", error.status];
|
return ["Не найдено.", error.status];
|
||||||
|
Loading…
Reference in New Issue
Block a user