Skip to content

Commit

Permalink
client side error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
harshsbhat committed Dec 26, 2024
1 parent fa3eaff commit b24b6a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/components/controlModals/delete-site.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ type deletProps = {


export function DeleteSite({params, currentInitHash}: deletProps) {
const { toast } = useToast()
const router = useRouter()
const { toast } = useToast()
const [inputValue, setInputValue] = useState("")
const [isConfirmed, setIsConfirmed] = useState(false)

Expand All @@ -40,7 +39,7 @@ export function DeleteSite({params, currentInitHash}: deletProps) {
description: response.message,
variant: "default",
});
router.push("/")
window.location.href = "/";
} catch (error) {
console.error("Error deleting note:", error);
toast({
Expand Down
4 changes: 1 addition & 3 deletions src/components/landing/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Navbar } from "@/components/navbar";
import { useState } from "react";
import { useRouter } from "next/navigation";
import Link from "next/link";

export default function Hero() {
const [inputValue, setInputValue] = useState("");
const router = useRouter();

const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (inputValue.trim()) {
router.push(`/${inputValue.trim()}`);
window.location.href = `/${inputValue.trim()}`;
}
};

Expand Down

0 comments on commit b24b6a1

Please sign in to comment.