diff --git a/app/settings/page.tsx b/app/settings/page.tsx index 4a4dd5a..33f0950 100644 --- a/app/settings/page.tsx +++ b/app/settings/page.tsx @@ -1,11 +1,11 @@ "use client"; -import { Page, PageTitle } from "@/components/Page"; -import { Button } from "@/components/ui/button"; -import { api } from "@/convex/_generated/api"; import { useAuthActions } from "@convex-dev/auth/react"; import { useMutation, useQuery } from "convex/react"; import { redirect, useRouter } from "next/navigation"; +import { Page, PageTitle } from "@/components/Page"; +import { Button } from "@/components/ui/button"; +import { api } from "@/convex/_generated/api"; export default function Settings() { const { signOut } = useAuthActions(); @@ -18,8 +18,8 @@ export default function Settings() { if (confirm("Are you sure you want to delete your account?")) { if (user) { await signOut(); - await deleteAccount({ userId: user._id }); - + await deleteAccount(); + router.push("/"); } } @@ -45,4 +45,4 @@ export default function Settings() { ); -} \ No newline at end of file +} diff --git a/simulators/zombie-survival/Entity.ts b/simulators/zombie-survival/Entity.ts index 1f2d3d5..5d68dd2 100644 --- a/simulators/zombie-survival/Entity.ts +++ b/simulators/zombie-survival/Entity.ts @@ -1,6 +1,5 @@ import { type Change, ChangeType } from "./Change"; import { Position } from "./Position"; -import { randomId } from "./lib/randomId"; export enum EntityType { Box, @@ -11,8 +10,6 @@ export enum EntityType { } export class Entity { - private id: string = randomId(); - protected destructible: boolean; protected changes: Change[] = []; protected health: number; @@ -47,10 +44,6 @@ export class Entity { this.health = 0; } - public eq(entity: Entity): boolean { - return this.id === entity.id; - } - public getChange(type: T) { const change = this.changes.find((change) => change.type === type); diff --git a/simulators/zombie-survival/lib/randomId.ts b/simulators/zombie-survival/lib/randomId.ts deleted file mode 100644 index 00e3d5c..0000000 --- a/simulators/zombie-survival/lib/randomId.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function randomId(): string { - const buf = new Uint8Array(8); - window.crypto.getRandomValues(buf); - return Buffer.from(buf).toString("hex"); -}