Skip to content

Commit

Permalink
remove random id
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevcody committed Oct 30, 2024
1 parent 9f37f35 commit 87c3537
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
12 changes: 6 additions & 6 deletions app/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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("/");
}
}
Expand All @@ -45,4 +45,4 @@ export default function Settings() {
</div>
</Page>
);
}
}
7 changes: 0 additions & 7 deletions simulators/zombie-survival/Entity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { type Change, ChangeType } from "./Change";
import { Position } from "./Position";
import { randomId } from "./lib/randomId";

export enum EntityType {
Box,
Expand All @@ -11,8 +10,6 @@ export enum EntityType {
}

export class Entity {
private id: string = randomId();

protected destructible: boolean;
protected changes: Change[] = [];
protected health: number;
Expand Down Expand Up @@ -47,10 +44,6 @@ export class Entity {
this.health = 0;
}

public eq(entity: Entity): boolean {
return this.id === entity.id;
}

public getChange<T extends ChangeType>(type: T) {
const change = this.changes.find((change) => change.type === type);

Expand Down
5 changes: 0 additions & 5 deletions simulators/zombie-survival/lib/randomId.ts

This file was deleted.

0 comments on commit 87c3537

Please sign in to comment.