mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Refactored dashboard sort logic.
This commit is contained in:
parent
42e87a4691
commit
62b032ab19
8 changed files with 32 additions and 40 deletions
|
|
@ -5,15 +5,14 @@ import { getItem, setItem } from 'lib/web';
|
|||
export const initialState = {
|
||||
showCharts: true,
|
||||
limit: DEFAULT_WEBSITE_LIMIT,
|
||||
websiteOrder: {},
|
||||
websiteOrder: [],
|
||||
editing: false,
|
||||
};
|
||||
|
||||
const store = create(() => ({ ...initialState, ...getItem(DASHBOARD_CONFIG) }));
|
||||
|
||||
export function saveDashboard(settings) {
|
||||
const state = typeof settings === 'function' ? settings(store.getState()) : settings;
|
||||
store.setState(state);
|
||||
store.setState(settings);
|
||||
|
||||
setItem(DASHBOARD_CONFIG, store.getState());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue