📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
some improvements
Blue Mousefc0185a7289b
diff --git a/src/pages/Project/View/ViewProject.jsx b/src/pages/Project/View/ViewProject.jsxindex 35f157ff6..4f06f61e0 100644--- a/src/pages/Project/View/ViewProject.jsx+++ b/src/pages/Project/View/ViewProject.jsx@@ -18,6 +18,7 @@ import _includes from 'lodash/includes'import _last from 'lodash/last'import _isEmpty from 'lodash/isEmpty'import _replace from 'lodash/replace'+import _values from 'lodash/values'import _find from 'lodash/find'import _filter from 'lodash/filter'import _startsWith from 'lodash/startsWith'@@ -59,6 +60,8 @@ import NoEvents from './components/NoEvents'import Filters from './components/Filters'import './styles.css'+const PROJECT_TABS_VALUES = _values(PROJECT_TABS)+const ViewProject = ({projects, isLoading: _isLoading, showError, cache, cachePerf, setProjectCache, projectViewPrefs, setProjectViewPrefs, setPublicProject,setLiveStatsForProject, authenticated, timezone, user, sharedProjects, isPaidTierUsed, extensions, generateAlert, setProjectCachePerf,@@ -117,7 +120,12 @@ const ViewProject = ({const url = new URL(window.location)const { searchParams } = urlconst tab = searchParams.get('tab')- return tab || projectTab || 'traffic'++ if (_includes(PROJECT_TABS_VALUES, tab)) {+ return tab+ }++ return projectTab || 'traffic'})const [chartDataPerf, setChartDataPerf] = useState({})@@ -1059,6 +1067,12 @@ const ViewProject = ({const url = new URL(window.location)const { searchParams } = urlconst intialPeriod = searchParams.get('period')+ const tab = searchParams.get('tab')++ if (tab === PROJECT_TABS.performance) {+ setProjectTab(PROJECT_TABS.performance)+ }+if (!_includes(validPeriods, intialPeriod) || (!isSharedProject && id !== SWETRIX_PID && !isPaidTierUsed && _includes(paidPeriods, intialPeriod))) {return}