fix(webui): preserve project when creating a topic from its menu

This commit is contained in:
chengyongru authored and chengyongru committed 2026-09-09 17:26:02 +08:00
1 parent 1469d4811c
commit fea28b1a00
2 files changed
+49 -2

No files matched your search

+10 -2
View File
@@ -316,7 +316,11 @@ function writeShellRoute(route: ShellRoute, replace = false): void {
);
return;
}
window.location.hash = nextHash;
window.history.pushState(
null,
"",
`${window.location.pathname}${window.location.search}${nextHash}`,
);
}
function bootstrapTokenExpiresAt(expiresInSeconds: number): number {
@@ -1135,7 +1139,11 @@ function Shell({
}
};
window.addEventListener("hashchange", applyRoute);
return () => window.removeEventListener("hashchange", applyRoute);
window.addEventListener("popstate", applyRoute);
return () => {
window.removeEventListener("hashchange", applyRoute);
window.removeEventListener("popstate", applyRoute);
};
}, []);
useEffect(() => {