Merge branch 'dev' into analytics

This commit is contained in:
Mike Cao 2024-03-21 13:38:04 -07:00
commit 0e44ce31a1
2 changed files with 6 additions and 5 deletions

View File

@ -20,7 +20,7 @@ export function LanguageSetting() {
const handleReset = () => saveLocale(DEFAULT_LOCALE);
const renderValue = (value: string | number) => languages[value].label;
const renderValue = (value: string | number) => languages?.[value]?.label;
return (
<Flexbox gap={10}>

View File

@ -99,12 +99,13 @@ function parseParameters(data: any[]) {
for (const [key, value] of searchParams) {
if (key.match(/^utm_(\w+)$/)) {
const name = decodeURIComponent(value);
if (!obj[key]) {
obj[key] = { [value]: +num };
} else if (!obj[key][value]) {
obj[key][value] = +num;
obj[key] = { [name]: +num };
} else if (!obj[key][name]) {
obj[key][name] = +num;
} else {
obj[key][value] += +num;
obj[key][name] += +num;
}
}
}