feat: Replace SessionStorage with LocalStorage
This commit is contained in:
parent
f5c15c2289
commit
15f05978a9
@ -36,7 +36,6 @@ interface IProps {
|
||||
setUserScoreDelta: (delta: number) => void;
|
||||
};
|
||||
|
||||
// TODO: Replace the sessionStorage with localStorage?
|
||||
export default class Application extends React.Component<IProps> {
|
||||
componentDidMount() {
|
||||
// TODO: When asking the server if our session is still valid, a spinner
|
||||
|
@ -1,11 +1,11 @@
|
||||
export function setSessionToken(window: Window, token: string) {
|
||||
window.sessionStorage.setItem("sessionToken", token);
|
||||
window.localStorage.setItem("sessionToken", token);
|
||||
};
|
||||
|
||||
export function getSessionToken(window: Window) {
|
||||
return window.sessionStorage.getItem("sessionToken");
|
||||
return window.localStorage.getItem("sessionToken");
|
||||
}
|
||||
|
||||
export function removeSessionToken(window: Window) {
|
||||
window.sessionStorage.removeItem("sessionToken");
|
||||
window.localStorage.removeItem("sessionToken");
|
||||
}
|
||||
|
Reference in New Issue
Block a user