diff --git a/src/components/Account/ProfileSettings.tsx b/src/components/Account/ProfileSettings.tsx
index cfbb04b..2194da7 100644
--- a/src/components/Account/ProfileSettings.tsx
+++ b/src/components/Account/ProfileSettings.tsx
@@ -1,8 +1,8 @@
'use client';
import React, { FC, useEffect, useState } from 'react';
-import { Button, Form, message, Upload } from 'antd';
-import type { GetProp, UploadFile, UploadProps } from 'antd';
+import { Form, message, Upload } from 'antd';
+import type { UploadFile } from 'antd';
import ImgCrop from 'antd-img-crop';
import { CameraOutlined, DeleteOutlined } from '@ant-design/icons';
import { useRouter } from '../../navigation';
@@ -12,17 +12,14 @@ import { validateImage } from '../../utils/account';
import { useProfileSettings } from '../../actions/hooks/useProfileSettings';
import { CustomInput } from '../view/CustomInput';
import { OutlinedButton } from '../view/OutlinedButton';
-import {FilledButton, FilledSquareButton, FilledYellowButton} from '../view/FilledButton';
+import { FilledSquareButton, FilledYellowButton } from '../view/FilledButton';
import { DeleteAccountModal } from '../Modals/DeleteAccountModal';
import { Loader } from '../view/Loader';
-import {ButtonProps} from "antd/es/button/button";
type ProfileSettingsProps = {
locale: string;
};
-type FileType = Parameters
>[0];
-
export const ProfileSettings: FC = ({ locale }) => {
const [form] = Form.useForm();
const { profileSettings, fetchProfileSettings, save, fetchLoading } = useProfileSettings(locale);
@@ -58,7 +55,7 @@ export const ProfileSettings: FC = ({ locale }) => {
const onSaveProfile = () => {
form.validateFields()
.then(({ login, surname, username }) => {
- const { phone, role, languagesLinks } = profileSettings;
+ const { phone, role, languagesLinks } = profileSettings || {};
const newProfile: ProfileRequest = {
phone,
role,
@@ -75,7 +72,7 @@ export const ProfileSettings: FC = ({ locale }) => {
reader.readAsDataURL(photo as File);
reader.onloadend = () => {
const newReg = new RegExp('data:image/(png|jpg|jpeg);base64,')
- newProfile.faceImage = reader.result.replace(newReg, '');
+ newProfile.faceImage = reader?.result?.replace(newReg, '');
newProfile.isFaceImageKeepExisting = false;
onSave(newProfile);
@@ -181,7 +178,7 @@ export const ProfileSettings: FC = ({ locale }) => {
>
{i18nText('save', locale)}
- router.push('change-password')}>
+ router.push('settings/change-password')}>
{i18nText('changePass', locale)}
{
const [userData] = useLocalStorage(AUTH_USER, '');
const { id: userId = 0 } = userData ? JSON.parse(userData) : {};
const router = useRouter();
+ const pathname = usePathname();
const fetchData = () => {
setErrorData(undefined);
@@ -66,7 +67,7 @@ export const SessionsTabs = ({ locale, activeTab }: SessionsTabsProps) => {
const onClickSession = (event: MouseEvent, id: number) => {
event.stopPropagation();
event.preventDefault();
- router.push(`${id}`);
+ router.push(`${pathname}/${id}`);
};
const getChildren = (list?: Session[]) => (
diff --git a/src/components/Modals/authModalContent/EnterContent.tsx b/src/components/Modals/authModalContent/EnterContent.tsx
index 004a776..6bcc377 100644
--- a/src/components/Modals/authModalContent/EnterContent.tsx
+++ b/src/components/Modals/authModalContent/EnterContent.tsx
@@ -6,7 +6,7 @@ import { AUTH_USER } from '../../../constants/common';
import { SocialConfig } from '../../../constants/social';
import { useOauthWindow } from '../../../hooks/useOauthWindow';
import { getAuth } from '../../../actions/auth';
-import { getPersonalData } from '../../../actions/profile';
+import {getPersonalData, getUserData} from '../../../actions/profile';
import { CustomInput } from '../../view/CustomInput';
import { CustomInputPassword } from '../../view/CustomInputPassword';
import { FilledButton } from '../../view/FilledButton';
@@ -39,7 +39,7 @@ export const EnterContent: FC = ({
getAuth(locale, { login, password })
.then((data) => {
if (data.jwtToken) {
- getPersonalData(locale, data.jwtToken)
+ getUserData(locale, data.jwtToken)
.then((profile) => {
localStorage.setItem(AUTH_USER, JSON.stringify(profile));
updateToken(data.jwtToken);