mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-24 08:43:51 +03:00
Fixed all visits interval not working after loading the default configured interval unless switching to another one first
This commit is contained in:
parent
6f5c5b122f
commit
ae625e4c8a
1 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue