Skip to content

Commit

Permalink
Fix stats cos I am stupid (#464)
Browse files Browse the repository at this point in the history
* Fix stats cos I am stupid

* Fix the types
  • Loading branch information
petrvecera authored May 17, 2024
1 parent b10ba9e commit bc40320
Show file tree
Hide file tree
Showing 5 changed files with 229 additions and 315 deletions.
2 changes: 2 additions & 0 deletions components/charts/card-factions-heatmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ const _FactionVsFactionCard: React.FC<IProps> = ({
if (key.includes("A")) {
const newKey = key.replaceAll("A", "U");
factionData[newKey] = rawFactionData[key];
} else {
factionData[key] = rawFactionData[key];
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"mantine-datatable": "6.0.8",
"next": "14.2.3",
"nprogress": "0.2.0",
"octokit": "3.2.1",
"octokit": "4.0.2",
"react": "18.3.1",
"react-chartjs-2": "5.2.0",
"react-dom": "18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion pages/api/appUpdateRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const date = new Date(response.data.published_at);
let sigURL: string | undefined;
let zipURL: string | undefined;
response.data.assets.forEach((asset) => {
response.data.assets.forEach((asset: { browser_download_url: string }) => {
if (asset.browser_download_url.split(".").at(-1) === "zip") {
zipURL = asset.browser_download_url;
}
Expand Down
12 changes: 8 additions & 4 deletions pages/desktop-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,16 @@ export const getServerSideProps: GetServerSideProps<any> = async () => {
let version = "";
if (response.status === 200) {
downloadCount = response.data.assets
.filter((asset) => asset.browser_download_url.split(".").at(-1) !== "sig")
.map((asset) => asset.download_count)
.reduce((a, b) => a + b);
.filter(
(asset: { browser_download_url: string }) =>
asset.browser_download_url.split(".").at(-1) !== "sig",
)
.map((asset: { download_count: any }) => asset.download_count)
.reduce((a: any, b: any) => a + b);
version = "v" + response.data.tag_name;
const msiAsset = response.data.assets.find(
(asset) => asset.browser_download_url.split(".").at(-1) === "msi",
(asset: { browser_download_url: string }) =>
asset.browser_download_url.split(".").at(-1) === "msi",
);
if (msiAsset) {
downloadURL = msiAsset.browser_download_url;
Expand Down
Loading

0 comments on commit bc40320

Please sign in to comment.