mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
fix UTC issues
This commit is contained in:
parent
004ccdc22f
commit
a15d0ca94a
6 changed files with 35 additions and 21 deletions
|
|
@ -1,13 +1,15 @@
|
|||
import { useTimezone } from 'components/hooks';
|
||||
import { REALTIME_INTERVAL } from 'lib/constants';
|
||||
import { RealtimeData } from 'lib/types';
|
||||
import { useApi } from './useApi';
|
||||
import { REALTIME_INTERVAL } from 'lib/constants';
|
||||
|
||||
export function useRealtime(websiteId: string) {
|
||||
const { get, useQuery } = useApi();
|
||||
const { timezone } = useTimezone();
|
||||
const { data, isLoading, error } = useQuery<RealtimeData>({
|
||||
queryKey: ['realtime', websiteId],
|
||||
queryKey: ['realtime', { websiteId, timezone }],
|
||||
queryFn: async () => {
|
||||
return get(`/realtime/${websiteId}`);
|
||||
return get(`/realtime/${websiteId}`, { timezone });
|
||||
},
|
||||
enabled: !!websiteId,
|
||||
refetchInterval: REALTIME_INTERVAL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue