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.
This commit is contained in:
2025-02-12 17:23:05 +01:00
parent c5181c42d8
commit af35a071a7

View File

@@ -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 {