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!

dashboard improvement

Blue Moused02b2b02ec2e
diff --git a/src/pages/Dashboard/Dashboard.jsx b/src/pages/Dashboard/Dashboard.jsx
index f83a96939..115350328 100644
--- a/src/pages/Dashboard/Dashboard.jsx
+++ b/src/pages/Dashboard/Dashboard.jsx
@@ -49,38 +49,40 @@ const ProjectCart = ({
</div>
<div className='mt-2 sm:flex sm:justify-between'>
<div className='sm:flex flex-col'>
- <div className='flex items-center mt-2 text-sm text-gray-500 dark:text-gray-300'>
- <EyeIcon className='flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-300' />
- {t('dashboard.pageviews')}
- :
- &nbsp;
- <dd className='flex items-baseline'>
- <p className='h-5 mr-1'>
- {overall?.thisWeek}
- </p>
- <p className={cx('flex text-xs -ml-1 items-baseline', {
- 'text-green-600': statsDidGrowUp,
- 'text-red-600': !statsDidGrowUp,
- })}>
- {statsDidGrowUp ? (
- <>
- <ArrowSmUpIcon className='self-center flex-shrink-0 h-4 w-4 text-green-500' />
- <span className='sr-only'>
- {t('dashboard.inc')}
- </span>
- </>
- ) : (
- <>
- <ArrowSmDownIcon className='self-center flex-shrink-0 h-4 w-4 text-red-500' />
- <span className='sr-only'>
- {t('dashboard.dec')}
- </span>
- </>
- )}
- {overall?.percChange}%
+ {overall && (
+ <div className='flex items-center mt-2 text-sm text-gray-500 dark:text-gray-300'>
+ <EyeIcon className='flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-300' />
+ {t('dashboard.pageviews')}
+ :
+ &nbsp;
+ <dd className='flex items-baseline'>
+ <p className='h-5 mr-1'>
+ {overall?.thisWeek}
</p>
- </dd>
- </div>
+ <p className={cx('flex text-xs -ml-1 items-baseline', {
+ 'text-green-600': statsDidGrowUp,
+ 'text-red-600': !statsDidGrowUp,
+ })}>
+ {statsDidGrowUp ? (
+ <>
+ <ArrowSmUpIcon className='self-center flex-shrink-0 h-4 w-4 text-green-500' />
+ <span className='sr-only'>
+ {t('dashboard.inc')}
+ </span>
+ </>
+ ) : (
+ <>
+ <ArrowSmDownIcon className='self-center flex-shrink-0 h-4 w-4 text-red-500' />
+ <span className='sr-only'>
+ {t('dashboard.dec')}
+ </span>
+ </>
+ )}
+ {overall?.percChange}%
+ </p>
+ </dd>
+ </div>
+ )}
<div className='mt-2 flex items-center text-sm text-gray-500 dark:text-gray-300 sm:mt-0'>
<PulsatingCircle className='flex-shrink-0 mr-3 ml-1' />
{t('dashboard.liveVisitors')}
diff --git a/src/redux/sagas/ui/load_projects.js b/src/redux/sagas/ui/load_projects.js
index fe2ac1400..f31453c87 100644
--- a/src/redux/sagas/ui/load_projects.js
+++ b/src/redux/sagas/ui/load_projects.js
@@ -14,11 +14,17 @@ export default function* loadProjects() {
try {
let { results } = yield call(getProjects)
const pids = _map(results, result => result.id)
- const overall = yield call(getOverallStats, pids)
+ let overall
+
+ try {
+ overall = yield call(getOverallStats, pids)
+ } catch (e) {
+ debug('failed to overall stats: %s', e)
+ }
results = _map(results, res => ({
...res,
- overall: overall[res.id],
+ overall: overall?.[res.id],
}))
yield put(UIActions.setProjects(results))