feat: Replace SessionStorage with LocalStorage

This commit is contained in:
Alexander Polynomdivision 2018-10-09 13:16:18 +02:00
parent f5c15c2289
commit 15f05978a9
2 changed files with 3 additions and 4 deletions

View File

@ -36,7 +36,6 @@ interface IProps {
setUserScoreDelta: (delta: number) => void; setUserScoreDelta: (delta: number) => void;
}; };
// TODO: Replace the sessionStorage with localStorage?
export default class Application extends React.Component<IProps> { export default class Application extends React.Component<IProps> {
componentDidMount() { componentDidMount() {
// TODO: When asking the server if our session is still valid, a spinner // TODO: When asking the server if our session is still valid, a spinner

View File

@ -1,11 +1,11 @@
export function setSessionToken(window: Window, token: string) { export function setSessionToken(window: Window, token: string) {
window.sessionStorage.setItem("sessionToken", token); window.localStorage.setItem("sessionToken", token);
}; };
export function getSessionToken(window: Window) { export function getSessionToken(window: Window) {
return window.sessionStorage.getItem("sessionToken"); return window.localStorage.getItem("sessionToken");
} }
export function removeSessionToken(window: Window) { export function removeSessionToken(window: Window) {
window.sessionStorage.removeItem("sessionToken"); window.localStorage.removeItem("sessionToken");
} }