mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
upgrade
This commit is contained in:
parent
6a8b804aff
commit
d62055537e
26 changed files with 2599 additions and 86 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { create } from 'zustand';
|
||||
import { produce } from 'immer';
|
||||
import { DateRange } from 'lib/types';
|
||||
import { DateRange } from '@/lib/types';
|
||||
|
||||
const store = create(() => ({}));
|
||||
|
||||
|
|
@ -18,4 +18,18 @@ export function setWebsiteDateRange(websiteId: string, dateRange: DateRange) {
|
|||
);
|
||||
}
|
||||
|
||||
export function setWebsiteDateCompare(websiteId: string, dateCompare: string) {
|
||||
store.setState(
|
||||
produce(state => {
|
||||
if (!state[websiteId]) {
|
||||
state[websiteId] = {};
|
||||
}
|
||||
|
||||
state[websiteId].dateCompare = dateCompare;
|
||||
|
||||
return state;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export default store;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue