save current board in session storage

This commit is contained in:
fbruc03 2022-11-15 16:54:09 +01:00
parent 2de54c0e9b
commit 22d11773e9
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import {
} from "./types";
export const setBoard = (board) => (dispatch) => {
window.localStorage.setItem("board", board);
window.sessionStorage.setItem("board", board);
dispatch({
type: BOARD,
payload: board,

View File

@ -1,8 +1,8 @@
import { BOARD } from '../actions/types';
const initialValue = () => {
if (window.localStorage.getItem("board")) {
return window.localStorage.getItem("board");
if (window.sessionStorage.getItem("board")) {
return window.sessionStorage.getItem("board");
}
return null;
};