diff --git a/app/javascript/mastodon/features/collections/components/collection_lockup.tsx b/app/javascript/mastodon/features/collections/components/collection_lockup.tsx index d72400cb8f..45cb59b089 100644 --- a/app/javascript/mastodon/features/collections/components/collection_lockup.tsx +++ b/app/javascript/mastodon/features/collections/components/collection_lockup.tsx @@ -27,10 +27,10 @@ export const AvatarGrid: React.FC<{ sensitive ? classes.avatarGridSensitive : null, )} > - {avatarIds.map((id) => ( + {avatarIds.map((id, index) => ( { [dispatch], ); + const accountId = useCurrentAccountId(); + const { acct: currentUserName } = useAccount(accountId) ?? {}; + const handleSubmit = useCallback( (e: React.FormEvent) => { e.preventDefault(); @@ -128,7 +133,7 @@ export const CollectionDetails: React.FC = () => { }), ).then((result) => { if (isFulfilled(result)) { - history.replace(`/collections`); + history.replace(`/@${currentUserName}/collections`); history.push(`/collections/${result.payload.collection.id}`, { newCollection: true, }); @@ -146,6 +151,7 @@ export const CollectionDetails: React.FC = () => { dispatch, history, accountIds, + currentUserName, ], );