mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
Updated date range handling. Fixed share page.
This commit is contained in:
parent
3fc5f5151b
commit
696d9c978c
28 changed files with 166 additions and 280 deletions
14
store/app.js
14
store/app.js
|
|
@ -1,10 +1,18 @@
|
|||
import create from 'zustand';
|
||||
import { DEFAULT_LOCALE, DEFAULT_THEME, LOCALE_CONFIG, THEME_CONFIG } from 'lib/constants';
|
||||
import {
|
||||
DATE_RANGE_CONFIG,
|
||||
DEFAULT_DATE_RANGE,
|
||||
DEFAULT_LOCALE,
|
||||
DEFAULT_THEME,
|
||||
LOCALE_CONFIG,
|
||||
THEME_CONFIG,
|
||||
} from 'lib/constants';
|
||||
import { getItem } from 'next-basics';
|
||||
|
||||
const initialState = {
|
||||
locale: getItem(LOCALE_CONFIG) || DEFAULT_LOCALE,
|
||||
theme: getItem(THEME_CONFIG) || DEFAULT_THEME,
|
||||
dateRange: getItem(DATE_RANGE_CONFIG) || DEFAULT_DATE_RANGE,
|
||||
shareToken: null,
|
||||
user: null,
|
||||
config: null,
|
||||
|
|
@ -32,4 +40,8 @@ export function setConfig(config) {
|
|||
store.setState({ config });
|
||||
}
|
||||
|
||||
export function setDateRange(dateRange) {
|
||||
store.setState({ dateRange });
|
||||
}
|
||||
|
||||
export default store;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue