Skip to content

Commit

Permalink
Merge pull request umami-software#1605 from umami-software/app
Browse files Browse the repository at this point in the history
v1.39.3
  • Loading branch information
mikecao authored Oct 26, 2022
2 parents aceb904 + 34791c3 commit ab4a60f
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion components/forms/WebsiteEditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function WebsiteEditForm({ values, onSave, onClose }) {
const [message, setMessage] = useState();

const handleSubmit = async values => {
const { id: websiteId } = values;
const { websiteUuid: websiteId } = values;

const { ok, data } = await post(websiteId ? `/websites/${websiteId}` : '/websites', values);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "umami",
"version": "1.39.2",
"version": "1.39.3",
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
"author": "Mike Cao <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion pages/api/websites/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async (req, res) => {
const websites =
isAdmin && include_all
? await getAllWebsites()
: await getUserWebsites({ userId: account.id });
: await getUserWebsites({ userId: account?.id });

return ok(res, websites);
}
Expand Down
2 changes: 1 addition & 1 deletion queries/admin/account/deleteAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function deleteAccount(userId) {
}),
])
.then(async res => {
if (redis.client) {
if (redis.enabled) {
for (let i = 0; i < websiteUuids.length; i++) {
await redis.set(`website:${websiteUuids[i]}`, DELETED);
}
Expand Down
4 changes: 2 additions & 2 deletions queries/admin/website/createWebsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export async function createWebsite(userId, data) {
},
})
.then(async res => {
if (redis.client && res) {
await redis.client.set(`website:${res.websiteUuid}`, res.id);
if (redis.enabled && res) {
await redis.set(`website:${res.websiteUuid}`, res.id);
}

return res;
Expand Down
4 changes: 2 additions & 2 deletions queries/admin/website/deleteWebsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export async function deleteWebsite(websiteUuid) {
where: { websiteUuid },
}),
]).then(async res => {
if (redis.client) {
await redis.client.set(`website:${websiteUuid}`, DELETED);
if (redis.enabled) {
await redis.set(`website:${websiteUuid}`, DELETED);
}

return res;
Expand Down
2 changes: 1 addition & 1 deletion queries/admin/website/getWebsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function getWebsite(where) {
})
.then(async data => {
if (redis.enabled && data) {
await redis.client.set(`website:${data.websiteUuid}`, data.id);
await redis.set(`website:${data.websiteUuid}`, data.id);
}

return data;
Expand Down
8 changes: 4 additions & 4 deletions queries/analytics/session/createSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async function relationalQuery(websiteId, data) {
},
})
.then(async res => {
if (redis.client && res) {
await redis.client.set(`session:${res.sessionUuid}`, 1);
if (redis.enabled && res) {
await redis.set(`session:${res.sessionUuid}`, 1);
}

return res;
Expand Down Expand Up @@ -59,7 +59,7 @@ async function clickhouseQuery(

await sendMessage(params, 'event');

if (redis.client) {
await redis.client.set(`session:${sessionUuid}`, 1);
if (redis.enabled) {
await redis.set(`session:${sessionUuid}`, 1);
}
}
8 changes: 4 additions & 4 deletions queries/analytics/session/getSessionByUuid.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ async function relationalQuery(sessionUuid) {
},
})
.then(async res => {
if (redis.client && res) {
await redis.client.set(`session:${res.sessionUuid}`, 1);
if (redis.enabled && res) {
await redis.set(`session:${res.sessionUuid}`, 1);
}

return res;
Expand Down Expand Up @@ -48,8 +48,8 @@ async function clickhouseQuery(sessionUuid) {
)
.then(result => findFirst(result))
.then(async res => {
if (redis.client && res) {
await redis.client.set(`session:${res.session_uuid}`, 1);
if (redis.enabled && res) {
await redis.set(`session:${res.session_uuid}`, 1);
}

return res;
Expand Down

0 comments on commit ab4a60f

Please sign in to comment.