mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-08-01 00:21:52 +00:00
Fixed fallback interval not working on visits pages
This commit is contained in:
@@ -122,6 +122,12 @@ export const VisitsStats: FC<VisitsStatsProps> = ({
|
|||||||
getVisits({ dateRange: resolvedDateRange, filter: visitsFilter }, isFirstLoad.current);
|
getVisits({ dateRange: resolvedDateRange, filter: visitsFilter }, isFirstLoad.current);
|
||||||
isFirstLoad.current = false;
|
isFirstLoad.current = false;
|
||||||
}, [dateRange, visitsFilter]);
|
}, [dateRange, visitsFilter]);
|
||||||
|
useEffect(() => {
|
||||||
|
// As soon as the fallback is loaded, if the initial interval used the settings one, we do fall back
|
||||||
|
if (fallbackInterval && initialInterval.current === (settings.visits?.defaultInterval ?? 'last30Days')) {
|
||||||
|
initialInterval.current = fallbackInterval;
|
||||||
|
}
|
||||||
|
}, [fallbackInterval]);
|
||||||
|
|
||||||
const renderVisitsContent = () => {
|
const renderVisitsContent = () => {
|
||||||
if (loadingLarge) {
|
if (loadingLarge) {
|
||||||
|
|||||||
Reference in New Issue
Block a user