Skip to content

Commit

Permalink
remove assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardozgz committed Jan 13, 2025
1 parent 5b1cd73 commit a3b8427
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions apps/website/src/app/status/BotStats.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import assert from "assert";
import { useMemo } from "react";
import Image from "next/image";
import { useTranslation } from "react-i18next";
Expand All @@ -18,8 +17,6 @@ export function BotStatus({
const icon =
id === "main" ? mainBotIcon : id === "premium" ? premiumBotIcon : null;

assert(icon);

const name =
id === "main"
? "Member Counter"
Expand Down Expand Up @@ -50,7 +47,7 @@ export function BotStatus({
return (
<article className="flex w-full max-w-[1200px] flex-col gap-2">
<h1 className="flex items-center gap-2 text-lg font-bold">
<Image {...icon} alt="" className="h-6 w-6 rounded-md" />
{icon && <Image {...icon} alt="" className="h-6 w-6 rounded-md" />}
{name}
</h1>
<div className="grid gap-2 md:grid-cols-3">
Expand Down
4 changes: 1 addition & 3 deletions apps/website/src/app/status/ServerInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import assert from "assert";
import { CpuIcon, MemoryStickIcon, ServerIcon } from "lucide-react";
import prettyBytes from "pretty-bytes";
import { useTranslation } from "react-i18next";
Expand All @@ -12,8 +11,7 @@ export function ServerInfo({
host: { name, cpus, freeMemory, memory, loadAvg },
}: NonNullable<RouterOutputs["bot"]["getStatus"][number]["stats"]>[number]) {
const { t, i18n } = useTranslation();
const recentLoadAvg = loadAvg[0];
assert(recentLoadAvg);
const recentLoadAvg = loadAvg[0] ?? 0;

const memoryUsage = ((memory - freeMemory) / memory) * 100;

Expand Down

0 comments on commit a3b8427

Please sign in to comment.