mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-05-29 16:46:16 +00:00
Fixed all visits interval not working after loading the default configured interval unless switching to another one first
This commit is contained in:
@@ -37,7 +37,7 @@ export const useVisitsQuery = (): [VisitsFiltering, UpdateFiltering] => {
|
|||||||
({ startDate, endDate, orphanVisitsType, excludeBots, domain }: VisitsQuery): VisitsFilteringAndDomain => ({
|
({ startDate, endDate, orphanVisitsType, excludeBots, domain }: VisitsQuery): VisitsFilteringAndDomain => ({
|
||||||
domain,
|
domain,
|
||||||
filtering: {
|
filtering: {
|
||||||
dateRange: startDate || endDate ? datesToDateRange(startDate, endDate) : undefined,
|
dateRange: startDate != null || endDate != null ? datesToDateRange(startDate, endDate) : undefined,
|
||||||
visitsFilter: { orphanVisitsType, excludeBots: excludeBots === 'true' },
|
visitsFilter: { orphanVisitsType, excludeBots: excludeBots === 'true' },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@@ -47,8 +47,8 @@ export const useVisitsQuery = (): [VisitsFiltering, UpdateFiltering] => {
|
|||||||
const updateFiltering = (extra: DeepPartial<VisitsFiltering>) => {
|
const updateFiltering = (extra: DeepPartial<VisitsFiltering>) => {
|
||||||
const { dateRange, visitsFilter } = mergeDeepRight(filtering, extra);
|
const { dateRange, visitsFilter } = mergeDeepRight(filtering, extra);
|
||||||
const query: VisitsQuery = {
|
const query: VisitsQuery = {
|
||||||
startDate: (dateRange?.startDate && formatIsoDate(dateRange.startDate)) || undefined,
|
startDate: (dateRange?.startDate && formatIsoDate(dateRange.startDate)) || '',
|
||||||
endDate: (dateRange?.endDate && formatIsoDate(dateRange.endDate)) || undefined,
|
endDate: (dateRange?.endDate && formatIsoDate(dateRange.endDate)) || '',
|
||||||
excludeBots: visitsFilter.excludeBots ? 'true' : undefined,
|
excludeBots: visitsFilter.excludeBots ? 'true' : undefined,
|
||||||
orphanVisitsType: visitsFilter.orphanVisitsType,
|
orphanVisitsType: visitsFilter.orphanVisitsType,
|
||||||
domain: theDomain,
|
domain: theDomain,
|
||||||
|
|||||||
Reference in New Issue
Block a user