This commit is contained in:
Kalle (Sendou)
2021-03-09 14:46:34 +02:00
parent b49c79acdb
commit 52f015d749

View File

@@ -23,6 +23,7 @@ import { FiEdit } from "react-icons/fi";
import { RiTShirtLine } from "react-icons/ri";
import useSWR from "swr";
import { GANBA_DISCORD_ID } from "utils/constants";
import { isCustomUrl } from "utils/validators/profile";
interface Props {
user: GetUserByIdentifierData;
@@ -65,6 +66,12 @@ const ProfilePage = (props: Props) => {
setBuildToEdit(true);
}, [canPostBuilds()]);
useEffect(() => {
const identifier = window.location.pathname.split("/")[2];
if (isCustomUrl(identifier) || !user.profile?.customUrlPath) return;
history.replaceState({}, "", `/u/${user.profile.customUrlPath}`);
}, []);
return (
<>
{showProfileModal && (