mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-29 14:25:20 +03:00
12 lines
319 B
TypeScript
12 lines
319 B
TypeScript
|
import { redirect } from "next/navigation";
|
||
|
|
||
|
export const redirectToPreviousPageOrChatPage = (): void => {
|
||
|
const previousPage = sessionStorage.getItem("previous-page");
|
||
|
if (previousPage === null) {
|
||
|
redirect("/chat");
|
||
|
} else {
|
||
|
sessionStorage.removeItem("previous-page");
|
||
|
redirect(previousPage);
|
||
|
}
|
||
|
};
|