Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

remove from localstorage

kruzhambus69725b04be40
diff --git a/src/pages/Project/View/ViewProject.tsx b/src/pages/Project/View/ViewProject.tsx
index ad9d37766..74902ad34 100644
--- a/src/pages/Project/View/ViewProject.tsx
+++ b/src/pages/Project/View/ViewProject.tsx
@@ -43,7 +43,7 @@ import {
tbPeriodPairs, getProjectCacheKey, LIVE_VISITORS_UPDATE_INTERVAL, DEFAULT_TIMEZONE, CDN_URL, isDevelopment,
timeBucketToDays, getProjectCacheCustomKey, roleViewer, MAX_MONTHS_IN_PAST, PROJECT_TABS,
TimeFormat, getProjectForcastCacheKey, chartTypes, roleAdmin, TRAFFIC_PANELS_ORDER, PERFORMANCE_PANELS_ORDER, isSelfhosted, tbPeriodPairsCompare,
- PERIOD_PAIRS_COMPARE, periodToCompareDate, filtersPeriodPairs, IS_ACTIVE_COMPARE,
+ PERIOD_PAIRS_COMPARE, periodToCompareDate, filtersPeriodPairs,
} from 'redux/constants'
import { IUser } from 'redux/models/IUser'
import { IProject, ILiveStats } from 'redux/models/IProject'
@@ -217,19 +217,7 @@ const ViewProject = ({
label: string
period: string
}[]>(tbPeriodPairsCompare(t))
- const [isActiveCompare, setIsActiveCompare] = useState<boolean>(() => {
- const activeCompare = getItem(IS_ACTIVE_COMPARE)
-
- if (typeof activeCompare === 'string') {
- return activeCompare === 'true'
- }
-
- if (typeof activeCompare === 'boolean') {
- return activeCompare
- }
-
- return false
- })
+ const [isActiveCompare, setIsActiveCompare] = useState<boolean>(false)
const [activePeriodCompare, setActivePeriodCompare] = useState<string>(periodPairsCompare[0].period)
const activeDropdownLabelCompare = useMemo(() => _find(periodPairsCompare, p => p.period === activePeriodCompare)?.label, [periodPairsCompare, activePeriodCompare])
const [dateRangeCompare, setDateRangeCompare] = useState<null | Date[]>(null)
@@ -1486,7 +1474,6 @@ const ViewProject = ({
// loadAnalytics when compare period change or compare selected
useEffect(() => {
- setItem(IS_ACTIVE_COMPARE, JSON.stringify(isActiveCompare))
if (activePeriodCompare === PERIOD_PAIRS_COMPARE.CUSTOM && !dateRangeCompare) {
return
}
diff --git a/src/redux/constants/index.ts b/src/redux/constants/index.ts
index 9bb0dc60f..d97717100 100644
--- a/src/redux/constants/index.ts
+++ b/src/redux/constants/index.ts
@@ -316,7 +316,6 @@ export const REFRESH_TOKEN: string = 'refresh_token'
// LocalStorage
export const PAGE_FORCE_REFRESHED = 'page-force-refreshed'
-export const IS_ACTIVE_COMPARE = 'is-active-compare'
// List of languages with translations available
export const whitelist: string[] = ['en', 'uk', 'pl', 'de', 'sv', 'el', 'ru', 'hi', 'zh']