Avoid url takeover and loading glitch

This commit is contained in:
Jordan Eldredge 2025-11-07 19:58:30 -08:00
parent d6245c7c7e
commit c778464c42
4 changed files with 8 additions and 7 deletions

View file

@ -36,6 +36,7 @@ export default function SkinPage({ skin, index, sessionId }: Props) {
alt={skin.fileName}
style={{
width: "100%",
aspectRatio: "275 / 348",
imageRendering: "pixelated",
}}
/>

View file

@ -3,6 +3,9 @@ import UserContext from "../../../../../data/UserContext";
import { getClientSkins, getSkinForSession } from "../../getClientSkins";
import SkinScroller from "../../SkinScroller";
// Ensure each page load gets a new session
export const dynamic = "force-dynamic";
export default async function Skin({ params }) {
const { md5 } = await params;

View file

@ -462,7 +462,10 @@ const urlEpic = (actions, state) => {
const newUrl = proposedUrl.toString();
window.history.replaceState({}, Selectors.getPageTitle(state), newUrl);
// Avoid clobbering URL for beta site
if (!window.location.href.includes("/scroll")) {
window.history.replaceState({}, Selectors.getPageTitle(state), newUrl);
}
}),
ignoreElements()
);

View file

@ -165,12 +165,6 @@ export const getRouteData = createSelector(
getPermalinkUrlFromHash,
skinData
) => {
const currentUrl = window.location.href;
// Hard code ignore "modern" paths for now.
if (currentUrl.includes("/scroll")) {
return { url: "/scroll/", title: "Scroll" };
}
if (activeContentPage === REVIEW_PAGE) {
return { url: "/review/", title: "Review" };
}