Compare commits
1 Commits
46cf3da755
...
bur-63
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
095df38e7e |
@@ -3,6 +3,6 @@ import { cloudApiUrl } from '../../shared/config/env';
|
||||
import type { HistoryRequest, HistoryResponse } from './types';
|
||||
|
||||
/** Запрашивает исторический ряд с avg-линией и min/max-диапазоном для графика. */
|
||||
export function getHistory(params: HistoryRequest): Promise<HistoryResponse> {
|
||||
return getJson<HistoryResponse>(cloudApiUrl, '/history', params);
|
||||
export function getHistory(params: HistoryRequest, signal?: AbortSignal): Promise<HistoryResponse> {
|
||||
return getJson<HistoryResponse>(cloudApiUrl, '/history', params, { signal });
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ export function ArchiveView({
|
||||
|
||||
{selectedTags.length ? (
|
||||
<HistoryChart
|
||||
key={`${range.from}:${range.to}:${selectedTags.join(',')}`}
|
||||
key={`${range.from}:${range.to}:${historyAxis.granulate}`}
|
||||
edge={edgeId}
|
||||
from={fromIso}
|
||||
to={toIso}
|
||||
|
||||
@@ -33,7 +33,7 @@ export function useHistoryChartQueries({
|
||||
const queries = useQueries({
|
||||
queries: tags.map((tag) => ({
|
||||
queryKey: ['history', edge, tag, from, to, granulate],
|
||||
queryFn: () => getHistory({ edge, tag, from, to, granulate }),
|
||||
queryFn: ({ signal }: { signal: AbortSignal }) => getHistory({ edge, tag, from, to, granulate }, signal),
|
||||
enabled,
|
||||
})),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user