Fix minor collection bugs (#38785)

This commit is contained in:
diondiondion 2026-04-23 10:37:22 +02:00 committed by GitHub
parent 1d1deaab2a
commit 540042dfe3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -27,10 +27,10 @@ export const AvatarGrid: React.FC<{
sensitive ? classes.avatarGridSensitive : null,
)}
>
{avatarIds.map((id) => (
{avatarIds.map((id, index) => (
<AvatarById
animate={false}
key={id}
key={index}
accountId={id}
className={classes.avatar}
size={25}

View File

@ -7,6 +7,8 @@ import { useHistory } from 'react-router-dom';
import { isFulfilled } from '@reduxjs/toolkit';
import { ComboboxMenuItem } from '@/mastodon/components/form_fields/combobox_field';
import { useAccount } from '@/mastodon/hooks/useAccount';
import { useCurrentAccountId } from '@/mastodon/hooks/useAccountId';
import { languages } from '@/mastodon/initial_state';
import {
hasSpecialCharacters,
@ -93,6 +95,9 @@ export const CollectionDetails: React.FC = () => {
[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,
],
);