mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user