properly load sessionstorage

This commit is contained in:
b1ek 2023-05-17 15:01:40 +10:00
parent 9f17e89b5b
commit 930a440b02
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 6 additions and 4 deletions

View File

@ -30,7 +30,7 @@ class IAPIObject {
_checkStorageSupport();
if (!window.sessionStorage.getItem(this.storage_key))
return false;
return new APIToken(window.sessionStorage.getItem(this.storage_key));
return new APIToken(JSON.parse(window.sessionStorage.getItem(this.storage_key)));
}
/** @returns {boolean} */

View File

@ -160,7 +160,6 @@ const CardApartament = function (props) {
</h3>
<Address>{props.results.address}, {props.results.floor} этаж из {props.results.floorHouse}</Address>
</a>
<TransportSection>
<TransportIcon>

View File

@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
import styled from 'styled-components';
import SVGIcon from '../UI/Icon/SVGIcon';
// import './styles/Header.css';
import { User } from '../../API/User';
const HeaderElement = styled.header`
min-width: 950px;
@ -56,6 +56,9 @@ const Navbar = styled.nav`
`;
const Header = function () {
const user = User.restoreFromLocalStorage();
return (
<HeaderElement>
<LogoSection>