Merge pull request #1069 from pajecawav/preserve-dashboard-settings

Preserve dashboard settings in localStorage
This commit is contained in:
Mike Cao 2022-04-04 15:19:07 -07:00 committed by GitHub
commit 0d4fe7eb5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ import {
THEME_CONFIG, THEME_CONFIG,
DEFAULT_WEBSITE_LIMIT, DEFAULT_WEBSITE_LIMIT,
} from 'lib/constants'; } from 'lib/constants';
import { getItem } from 'lib/web'; import { getItem, setItem } from 'lib/web';
export const defaultDashboardConfig = { export const defaultDashboardConfig = {
showCharts: true, showCharts: true,
@ -42,6 +42,7 @@ export function setUser(user) {
export function setDashboard(dashboard) { export function setDashboard(dashboard) {
store.setState({ dashboard }); store.setState({ dashboard });
setItem(DASHBOARD_CONFIG, dashboard);
} }
export default store; export default store;