mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
fork refine
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import React from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { setLastLocation } from "src/utils/last-location";
|
||||
|
||||
export const LocationChangeHandler = () => {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
React.useEffect(() => {
|
||||
if (
|
||||
typeof window !== "undefined" &&
|
||||
typeof localStorage !== "undefined"
|
||||
) {
|
||||
setLastLocation(pathname);
|
||||
}
|
||||
}, [pathname]);
|
||||
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user