properly load sessionstorage
This commit is contained in:
parent
9f17e89b5b
commit
930a440b02
|
@ -30,7 +30,7 @@ class IAPIObject {
|
||||||
_checkStorageSupport();
|
_checkStorageSupport();
|
||||||
if (!window.sessionStorage.getItem(this.storage_key))
|
if (!window.sessionStorage.getItem(this.storage_key))
|
||||||
return false;
|
return false;
|
||||||
return new APIToken(window.sessionStorage.getItem(this.storage_key));
|
return new APIToken(JSON.parse(window.sessionStorage.getItem(this.storage_key)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {boolean} */
|
/** @returns {boolean} */
|
||||||
|
|
|
@ -160,7 +160,6 @@ const CardApartament = function (props) {
|
||||||
|
|
||||||
</h3>
|
</h3>
|
||||||
<Address>{props.results.address}, {props.results.floor} этаж из {props.results.floorHouse}</Address>
|
<Address>{props.results.address}, {props.results.floor} этаж из {props.results.floorHouse}</Address>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
<TransportSection>
|
<TransportSection>
|
||||||
<TransportIcon>
|
<TransportIcon>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import SVGIcon from '../UI/Icon/SVGIcon';
|
import SVGIcon from '../UI/Icon/SVGIcon';
|
||||||
|
|
||||||
// import './styles/Header.css';
|
import { User } from '../../API/User';
|
||||||
|
|
||||||
const HeaderElement = styled.header`
|
const HeaderElement = styled.header`
|
||||||
min-width: 950px;
|
min-width: 950px;
|
||||||
|
@ -56,6 +56,9 @@ const Navbar = styled.nav`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Header = function () {
|
const Header = function () {
|
||||||
|
|
||||||
|
const user = User.restoreFromLocalStorage();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HeaderElement>
|
<HeaderElement>
|
||||||
<LogoSection>
|
<LogoSection>
|
||||||
|
|
Loading…
Reference in New Issue