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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user