diff --git a/frontend/components/dashboard/navbar/search.tsx b/frontend/components/dashboard/navbar/search.tsx
index 65e731f..f254efe 100644
--- a/frontend/components/dashboard/navbar/search.tsx
+++ b/frontend/components/dashboard/navbar/search.tsx
@@ -6,27 +6,34 @@ import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
export default function DashboardNavbarSearch() {
- const [search, setSearch] = useState("");
+ // const [search, setSearch] = useState("");
const router = useRouter();
- useEffect(() => {
- const delayDebounceFn = setTimeout(() => {
- if (search) {
- router.push(`/dashboard?q=${search}`);
- } else {
- router.push(`/dashboard`);
- }
- }, 300);
+ // useEffect(() => {
+ // const delayDebounceFn = setTimeout(() => {
+ // if (search) {
+ // router.push(`/dashboard?q=${search}`);
+ // } else {
+ // router.push(`/dashboard`);
+ // }
+ // }, 300);
- return () => clearTimeout(delayDebounceFn);
- }, [search]);
+ // return () => clearTimeout(delayDebounceFn);
+ // }, [search]);
return (
{showGradient && (
-
+
)}
);
diff --git a/frontend/components/editor/index.tsx b/frontend/components/editor/index.tsx
index 0e7fd8b..d4e2f2a 100644
--- a/frontend/components/editor/index.tsx
+++ b/frontend/components/editor/index.tsx
@@ -4,7 +4,7 @@ import dynamic from "next/dynamic";
import Loading from "@/components/editor/loading";
import { Sandbox, User } from "@/lib/types";
import { useEffect, useState } from "react";
-import { startServer } from "@/lib/utils";
+// import { startServer } from "@/lib/utils";
import { toast } from "sonner";
const CodeEditor = dynamic(() => import("@/components/editor/editor"), {
@@ -23,18 +23,15 @@ export default function Editor({
const [didFail, setDidFail] = useState(false);
useEffect(() => {
- startServer(sandboxData.id, userData.id, (success: boolean) => {
- if (!success) {
- toast.error("Failed to start server.");
- setDidFail(true);
- } else {
- setIsServerRunning(true);
- }
- });
-
- // return () => {
- // stopServer(sandboxData.id, userData.id);
- // };
+ // startServer(sandboxData.id, userData.id, (success: boolean) => {
+ // if (!success) {
+ // toast.error("Failed to start server.");
+ // setDidFail(true);
+ // } else {
+ // setIsServerRunning(true);
+ // }
+ // });
+ console.log("startServer");
}, []);
if (!isServerRunning || didFail)
diff --git a/frontend/components/ui/userButton.tsx b/frontend/components/ui/userButton.tsx
index dc701b5..a7bd392 100644
--- a/frontend/components/ui/userButton.tsx
+++ b/frontend/components/ui/userButton.tsx
@@ -54,10 +54,11 @@ export default function UserButton({ userData }: { userData: User }) {
-
+
+ {/*
Edit Profile
-
+ */}
signOut(() => router.push("/"))}
className="!text-destructive cursor-pointer"
diff --git a/frontend/lib/utils.ts b/frontend/lib/utils.ts
index 3886ffc..ecc6ced 100644
--- a/frontend/lib/utils.ts
+++ b/frontend/lib/utils.ts
@@ -62,32 +62,32 @@ export function addNew(
}
}
-export async function startServer(
- sandboxId: string,
- userId: string,
- callback: (success: boolean) => void
-) {
- try {
- const res = await fetch("http://localhost:4001/start", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- sandboxId,
- userId,
- }),
- });
+// export async function startServer(
+// sandboxId: string,
+// userId: string,
+// callback: (success: boolean) => void
+// ) {
+// try {
+// const res = await fetch("http://localhost:4001/start", {
+// method: "POST",
+// headers: {
+// "Content-Type": "application/json",
+// },
+// body: JSON.stringify({
+// sandboxId,
+// userId,
+// }),
+// });
- if (res.status !== 200) {
- console.error("Failed to start server", res);
- callback(false);
- }
+// if (res.status !== 200) {
+// console.error("Failed to start server", res);
+// callback(false);
+// }
- callback(true);
- } catch (error) {
- console.error("Failed to start server", error);
+// callback(true);
+// } catch (error) {
+// console.error("Failed to start server", error);
- callback(false);
- }
-}
+// callback(false);
+// }
+// }