From af35a071a731e973e833becae0184c22bc991067 Mon Sep 17 00:00:00 2001 From: Denshooter Date: Wed, 12 Feb 2025 17:23:05 +0100 Subject: [PATCH] refactor: clean up project details URL handling Removes unnecessary TypeScript error suppression for window object usage in the ProjectDetails component. This change improves code clarity and maintains functionality by ensuring the project data is removed from the URL without reloading the page. --- app/Projects/[slug]/page.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Projects/[slug]/page.tsx b/app/Projects/[slug]/page.tsx index 9724d06..ebab8db 100644 --- a/app/Projects/[slug]/page.tsx +++ b/app/Projects/[slug]/page.tsx @@ -45,12 +45,9 @@ const ProjectDetails = () => { if (projectData) { setProject(JSON.parse(projectData as string)); // Remove the project data from the URL without reloading the page - // @ts-expect-error window is defined if (typeof window !== "undefined") { - // @ts-expect-error window is defined const url = new URL(window.location.href); url.searchParams.delete("project"); - // @ts-expect-error window is defined window.history.replaceState({}, "", url.toString()); } } else {