[Glitch] Fix local collection link resulting in error page

Port d0e7692d79 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion
2026-03-03 18:34:37 +01:00
committed by Claire
parent 3fecef0bb1
commit 0ae3733a22
2 changed files with 4 additions and 4 deletions

View File

@@ -105,8 +105,8 @@ const CollectionHeader: React.FC<{ collection: ApiCollectionJSON }> = ({
);
}, [collection, dispatch]);
const location = useLocation<{ newCollection?: boolean }>();
const wasJustCreated = location.state.newCollection;
const location = useLocation<{ newCollection?: boolean } | undefined>();
const wasJustCreated = location.state?.newCollection;
useEffect(() => {
if (wasJustCreated) {
handleShare();