fix: save file not counting towards filter count and profiles showing wrong buttons

This commit is contained in:
trafficlunar 2026-04-27 12:14:39 +01:00
parent 73222c266f
commit 48df28b285
2 changed files with 4 additions and 2 deletions

View file

@ -21,6 +21,7 @@ export default function FilterMenu() {
const rawTags = searchParams.get("tags") || ""; const rawTags = searchParams.get("tags") || "";
const rawExclude = searchParams.get("exclude") || ""; const rawExclude = searchParams.get("exclude") || "";
const allowCopying = (searchParams.get("allowCopying") as unknown as boolean) || false; const allowCopying = (searchParams.get("allowCopying") as unknown as boolean) || false;
const isFromSaveFile = (searchParams.get("isFromSaveFile") as unknown as boolean) || false;
const tags = useMemo( const tags = useMemo(
() => () =>
@ -66,9 +67,10 @@ export default function FilterMenu() {
if (gender) count++; if (gender) count++;
if (allowCopying) count++; if (allowCopying) count++;
if (makeup) count++; if (makeup) count++;
if (isFromSaveFile) count++;
setFilterCount(count); setFilterCount(count);
}, [tags, exclude, platform, gender, allowCopying, makeup]); }, [tags, exclude, platform, gender, allowCopying, makeup, isFromSaveFile]);
return ( return (
<div className="relative"> <div className="relative">

View file

@ -46,7 +46,7 @@ export default function ProfileLayout() {
const isAdmin = userId === Number(import.meta.env.VITE_ADMIN_USER_ID); const isAdmin = userId === Number(import.meta.env.VITE_ADMIN_USER_ID);
const isContributor = import.meta.env.VITE_CONTRIBUTORS_USER_IDS?.split(",").includes(String(user?.id)); const isContributor = import.meta.env.VITE_CONTRIBUTORS_USER_IDS?.split(",").includes(String(user?.id));
const isOwnProfile = userId === user?.id; const isOwnProfile = $session?.user?.id && userId === Number($session.user.id);
const joinDate = new Date(user.createdAt).toLocaleDateString("en-US", { month: "long", year: "numeric" }); const joinDate = new Date(user.createdAt).toLocaleDateString("en-US", { month: "long", year: "numeric" });
const metaTitle = `${user.name} - TomodachiShare`; const metaTitle = `${user.name} - TomodachiShare`;