15 lines
437 B
TypeScript
15 lines
437 B
TypeScript
"use client";
|
|
|
|
export function pushSessionUrl(sessionId: string) {
|
|
if (typeof window === "undefined") return;
|
|
const target = `/session/${encodeURIComponent(sessionId)}`;
|
|
if (window.location.pathname === target) return;
|
|
window.history.pushState(null, "", target);
|
|
}
|
|
|
|
export function pushHomeUrl() {
|
|
if (typeof window === "undefined") return;
|
|
if (window.location.pathname === "/") return;
|
|
window.history.pushState(null, "", "/");
|
|
}
|