fix results page
This commit is contained in:
parent
3c466a98d3
commit
1e60984d64
9 changed files with 267 additions and 136 deletions
|
|
@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|||
import styles from './Account.module.css';
|
||||
import AccountImg from '../../assets/account.svg?react';
|
||||
import { getCurrentUser } from '../../api/AuthApi';
|
||||
import {handleUnauthorizedError} from "../../api/BaseApi.ts";
|
||||
|
||||
interface AccountProps {
|
||||
href: string;
|
||||
|
|
@ -17,6 +18,7 @@ const Account: React.FC<AccountProps> = ({ href }) => {
|
|||
const userData = await getCurrentUser();
|
||||
setUserName(`${userData.firstName} ${userData.lastName}`);
|
||||
} catch (error) {
|
||||
handleUnauthorizedError(error)
|
||||
console.error("Ошибка загрузки данных пользователя:", error);
|
||||
localStorage.removeItem("user");
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue