save current board in session storage
This commit is contained in:
parent
2de54c0e9b
commit
22d11773e9
@ -3,7 +3,7 @@ import {
|
|||||||
} from "./types";
|
} from "./types";
|
||||||
|
|
||||||
export const setBoard = (board) => (dispatch) => {
|
export const setBoard = (board) => (dispatch) => {
|
||||||
window.localStorage.setItem("board", board);
|
window.sessionStorage.setItem("board", board);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BOARD,
|
type: BOARD,
|
||||||
payload: board,
|
payload: board,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { BOARD } from '../actions/types';
|
import { BOARD } from '../actions/types';
|
||||||
|
|
||||||
const initialValue = () => {
|
const initialValue = () => {
|
||||||
if (window.localStorage.getItem("board")) {
|
if (window.sessionStorage.getItem("board")) {
|
||||||
return window.localStorage.getItem("board");
|
return window.sessionStorage.getItem("board");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user