Fix minor collection bugs (#38785)
This commit is contained in:
parent
1d1deaab2a
commit
540042dfe3
@ -27,10 +27,10 @@ export const AvatarGrid: React.FC<{
|
|||||||
sensitive ? classes.avatarGridSensitive : null,
|
sensitive ? classes.avatarGridSensitive : null,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{avatarIds.map((id) => (
|
{avatarIds.map((id, index) => (
|
||||||
<AvatarById
|
<AvatarById
|
||||||
animate={false}
|
animate={false}
|
||||||
key={id}
|
key={index}
|
||||||
accountId={id}
|
accountId={id}
|
||||||
className={classes.avatar}
|
className={classes.avatar}
|
||||||
size={25}
|
size={25}
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import { useHistory } from 'react-router-dom';
|
|||||||
import { isFulfilled } from '@reduxjs/toolkit';
|
import { isFulfilled } from '@reduxjs/toolkit';
|
||||||
|
|
||||||
import { ComboboxMenuItem } from '@/mastodon/components/form_fields/combobox_field';
|
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 { languages } from '@/mastodon/initial_state';
|
||||||
import {
|
import {
|
||||||
hasSpecialCharacters,
|
hasSpecialCharacters,
|
||||||
@ -93,6 +95,9 @@ export const CollectionDetails: React.FC = () => {
|
|||||||
[dispatch],
|
[dispatch],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const accountId = useCurrentAccountId();
|
||||||
|
const { acct: currentUserName } = useAccount(accountId) ?? {};
|
||||||
|
|
||||||
const handleSubmit = useCallback(
|
const handleSubmit = useCallback(
|
||||||
(e: React.FormEvent) => {
|
(e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -128,7 +133,7 @@ export const CollectionDetails: React.FC = () => {
|
|||||||
}),
|
}),
|
||||||
).then((result) => {
|
).then((result) => {
|
||||||
if (isFulfilled(result)) {
|
if (isFulfilled(result)) {
|
||||||
history.replace(`/collections`);
|
history.replace(`/@${currentUserName}/collections`);
|
||||||
history.push(`/collections/${result.payload.collection.id}`, {
|
history.push(`/collections/${result.payload.collection.id}`, {
|
||||||
newCollection: true,
|
newCollection: true,
|
||||||
});
|
});
|
||||||
@ -146,6 +151,7 @@ export const CollectionDetails: React.FC = () => {
|
|||||||
dispatch,
|
dispatch,
|
||||||
history,
|
history,
|
||||||
accountIds,
|
accountIds,
|
||||||
|
currentUserName,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user