Fix duplicate hidden entries in analytics (#3576)
This commit is contained in:
parent
5e7444f115
commit
3d9be0cc3f
@ -86,8 +86,8 @@
|
||||
<UpdatedIcon />
|
||||
</Button>
|
||||
<DropdownSelect
|
||||
class="range-dropdown"
|
||||
v-model="selectedRange"
|
||||
class="range-dropdown"
|
||||
:options="ranges"
|
||||
name="Time range"
|
||||
:display-name="
|
||||
@ -197,11 +197,11 @@
|
||||
>
|
||||
<div class="country-flag-container">
|
||||
<template v-if="name.toLowerCase() === 'xx' || !name">
|
||||
<img
|
||||
src="https://cdn.modrinth.com/placeholder-banner.svg"
|
||||
alt="Placeholder flag"
|
||||
class="country-flag"
|
||||
/>
|
||||
<div
|
||||
class="country-flag flex select-none items-center justify-center bg-bg-raised font-extrabold text-secondary"
|
||||
>
|
||||
?
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<img
|
||||
@ -213,7 +213,7 @@
|
||||
</div>
|
||||
<div class="country-text">
|
||||
<strong class="country-name"
|
||||
><template v-if="name.toLowerCase() === 'xx' || !name">Hidden</template>
|
||||
><template v-if="name.toLowerCase() === 'xx' || !name">Other</template>
|
||||
<template v-else>{{ countryCodeToName(name) }}</template>
|
||||
</strong>
|
||||
<span class="data-point">{{ formatNumber(count) }}</span>
|
||||
|
||||
@ -262,8 +262,9 @@ export const processAnalyticsByCountry = (category, projects, sortFn) => {
|
||||
|
||||
loadedProjectData.forEach((data) => {
|
||||
Object.entries(data).forEach(([country, value]) => {
|
||||
const current = countrySums.get(country) || 0;
|
||||
countrySums.set(country, current + value);
|
||||
const countryCode = country || "XX";
|
||||
const current = countrySums.get(countryCode) || 0;
|
||||
countrySums.set(countryCode, current + value);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user