Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix event data check.

Mike Cao4cc22fcc95b7
diff --git a/package.json b/package.json
index 516c1783e..9d1ba3dae 100644
--- a/package.json
+++ b/package.json
@@ -84,7 +84,7 @@
"maxmind": "^4.3.6",
"moment-timezone": "^0.5.35",
"next": "^12.3.1",
- "next-basics": "^0.23.0",
+ "next-basics": "^0.24.0",
"node-fetch": "^3.2.8",
"npm-run-all": "^4.1.5",
"prop-types": "^15.7.2",
diff --git a/pages/api/collect.ts b/pages/api/collect.ts
index 254689fe1..9246c9c6e 100644
--- a/pages/api/collect.ts
+++ b/pages/api/collect.ts
@@ -35,9 +35,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
let { url } = payload;
// Validate eventData is JSON
- const valid = eventData && typeof eventData === 'object' && !Array.isArray(eventData);
-
- if (!valid) {
+ if (eventData && !(typeof eventData === 'object' && !Array.isArray(eventData))) {
return badRequest(res, 'Event Data must be in the form of a JSON Object.');
}
diff --git a/styles/index.css b/styles/index.css
index bc8638692..4159bb98c 100644
--- a/styles/index.css
+++ b/styles/index.css
@@ -13,8 +13,8 @@ body {
display: flex;
flex-direction: column;
flex: 1;
- color: var(--base800);
- background: var(--base100);
+ color: var(--font-color100);
+ background: var(--background200);
}
.zh-CN {
diff --git a/yarn.lock b/yarn.lock
index 5daa7d28d..288c9bd51 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5445,10 +5445,10 @@ natural-compare@^1.4.0:
resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz"
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
-next-basics@^0.23.0:
- version "0.23.0"
- resolved "https://registry.yarnpkg.com/next-basics/-/next-basics-0.23.0.tgz#6ccc4b5f3cd87550b07d280c2a3bdee26f557912"
- integrity sha512-AwKipMFkxS84ZKFDVSo8ZHXoOVzF2sPZp21pgtGlqf9aUmj48+QtxdM6ZnJVRg8Savf48ENjeYzeiu5I8Z4l/w==
+next-basics@^0.24.0:
+ version "0.24.0"
+ resolved "https://registry.yarnpkg.com/next-basics/-/next-basics-0.24.0.tgz#21ebd34276b3a957b1f6c644de494cc1a17953ea"
+ integrity sha512-N0wABIkzFpDIoxSEyeLZ8wNENLhcQtPqEY/mKLzpNfr4x4bQ0c5qnXEtrNEftWeQt0osjiuL5yFlnXOOQgTHpQ==
dependencies:
base-x "^4.0.0"
bcryptjs "^2.4.3"