From 54fd54a6c734a7feaad10262b1a887c504c0314a Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 19 Feb 2024 20:09:44 +0100 Subject: [PATCH] account export --- src/App.js | 4 ---- src/Components/AppRoutes/index.js | 10 --------- src/Pages/RedirectToDemo/index.js | 34 ------------------------------- src/Pages/UserProfile/index.js | 7 +++++-- 4 files changed, 5 insertions(+), 50 deletions(-) delete mode 100644 src/Pages/RedirectToDemo/index.js diff --git a/src/App.js b/src/App.js index 2099f5e..fde0596 100644 --- a/src/App.js +++ b/src/App.js @@ -132,10 +132,6 @@ export function App() { options={{ username: appUserData.user.username, permissions: appUserData.permissions, - accountPlanExpiry: - appUserData.user.account_plan_expiry === null - ? undefined - : appUserData.user.account_plan_expiry, }} > diff --git a/src/Components/AppRoutes/index.js b/src/Components/AppRoutes/index.js index a5c2ad9..1d2772b 100644 --- a/src/Components/AppRoutes/index.js +++ b/src/Components/AppRoutes/index.js @@ -26,7 +26,6 @@ const StoreCalendarAuth = lazy(() => import("../../Pages/Store/Calendar/Auth")); //const Support = lazy(() => import("../../Pages/Support")); //const Feedback = lazy(() => import("../../Pages/Feedback")); const UserProfile = lazy(() => import("../../Pages/UserProfile")); -const RedirectToDemo = lazy(() => import("../../Pages/RedirectToDemo")); export function AuthenticationRoutes() { return ( @@ -85,15 +84,6 @@ export function AuthenticationRoutes() { } /> - - - - } - /> - } diff --git a/src/Pages/RedirectToDemo/index.js b/src/Pages/RedirectToDemo/index.js deleted file mode 100644 index 374b3f4..0000000 --- a/src/Pages/RedirectToDemo/index.js +++ /dev/null @@ -1,34 +0,0 @@ -import { useEffect } from "react"; -import MyCenteredSpin from "../../Components/MyCenteredSpin"; -import { - myFetch, - setUserSessionToLocalStorage, - showUnkownErrorNotification, -} from "../../utils"; -import { useTranslation } from "react-i18next"; -import { notification } from "antd"; - -export default function RedirectToDemo() { - const { t } = useTranslation(); - const [notificationApi, notificationContextHolder] = - notification.useNotification(); - - useEffect(() => { - myFetch({ - url: "/user/demo", - method: "GET", - }) - .then((response) => { - setUserSessionToLocalStorage(response.XAuthorization); - window.location.href = "/"; - }) - .catch(() => showUnkownErrorNotification(notificationApi, t)); - }, []); - - return ( - <> - {notificationContextHolder} - - - ); -} diff --git a/src/Pages/UserProfile/index.js b/src/Pages/UserProfile/index.js index cc9bd4d..415c1f8 100644 --- a/src/Pages/UserProfile/index.js +++ b/src/Pages/UserProfile/index.js @@ -3,7 +3,6 @@ import { Card, Col, Form, - Input, Popconfirm, Radio, Row, @@ -24,6 +23,7 @@ import { myFetch, showInputsInvalidNotification, showPasswordIncorrectNotification, + showUnkownErrorNotification, } from "../../utils"; import { useTranslation } from "react-i18next"; import { useEffect, useRef, useState } from "react"; @@ -778,7 +778,10 @@ function YourAccountExportDataCard({ notificationApi }) { if (errStatus === 400) { showPasswordIncorrectNotification(notificationApi, t); + return; } + + showUnkownErrorNotification(notificationApi, t); }); }) .catch(() => showInputsInvalidNotification(notificationApi, t)); @@ -792,7 +795,7 @@ function YourAccountExportDataCard({ notificationApi }) { {t("userProfile.accountExport.modal.info")} - +