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!

fix paid period for url parsing

Blue Mouse9cbb837573c5
diff --git a/src/pages/Project/View/ViewProject.jsx b/src/pages/Project/View/ViewProject.jsx
index 8ad7a1f30..5eacd5e8c 100644
--- a/src/pages/Project/View/ViewProject.jsx
+++ b/src/pages/Project/View/ViewProject.jsx
@@ -219,6 +219,7 @@ const getSettings = (chart, timeBucket, showTotal, applyRegions) => {
const validTimeBacket = ['hour', 'day', 'week', 'month']
const validPeriods = ['custom', 'today', 'yesterday', '1d', '7d', '4w', '3M', '12M', '24M']
+const paidPeriods = ['12M', '24M']
const validFilters = ['cc', 'pg', 'lc', 'ref', 'dv', 'br', 'os', 'so', 'me', 'ca', 'lt']
const typeNameMapping = (t) => ({
@@ -792,7 +793,7 @@ const ViewProject = ({
const url = new URL(window.location)
const { searchParams } = url
const intialPeriod = searchParams.get('period')
- if (!_includes(validPeriods, intialPeriod)) {
+ if (!_includes(validPeriods, intialPeriod) || (!isPaidTierUsed && _includes(paidPeriods, intialPeriod))) {
return
}