Skip to content

Commit

Permalink
Merge pull request umami-software#905 from p-chan/add-screen-fallback
Browse files Browse the repository at this point in the history
Fix runtime error when device is null
  • Loading branch information
mikecao authored Jan 13, 2022
2 parents 884dee0 + 56c0837 commit 2e1db5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/metrics/RealtimeLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Tag from 'components/common/Tag';
import Dot from 'components/common/Dot';
import FilterButtons from 'components/common/FilterButtons';
import NoData from 'components/common/NoData';
import { devices } from 'components/messages';
import { devices, getDeviceMessage } from 'components/messages';
import useLocale from 'hooks/useLocale';
import useCountryNames from 'hooks/useCountryNames';
import { BROWSERS } from 'lib/constants';
Expand Down Expand Up @@ -137,7 +137,7 @@ export default function RealtimeLog({ data, websites, websiteId }) {
),
browser: <b>{BROWSERS[browser]}</b>,
os: <b>{os}</b>,
device: <b>{intl.formatMessage(devices[device])?.toLowerCase()}</b>,
device: <b>{getDeviceMessage(devices[device])}</b>,
}}
/>
);
Expand Down
2 changes: 2 additions & 0 deletions pages/api/collect.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { createToken } from 'lib/crypto';
export default async (req, res) => {
await useCors(req, res);

console.log('hi!');

if (isbot(req.headers['user-agent'])) {
return ok(res);
}
Expand Down

0 comments on commit 2e1db5b

Please sign in to comment.