[Glitch] Fix minor collection bugs
Port 540042dfe3186c52237cde3562b40f50eeb75be9 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
8f9d4f1463
commit
41c68365ff
@ -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}
|
||||
|
||||
@ -7,6 +7,8 @@ import { useHistory } from 'react-router-dom';
|
||||
import { isFulfilled } from '@reduxjs/toolkit';
|
||||
|
||||
import { ComboboxMenuItem } from '@/flavours/glitch/components/form_fields/combobox_field';
|
||||
import { useAccount } from '@/flavours/glitch/hooks/useAccount';
|
||||
import { useCurrentAccountId } from '@/flavours/glitch/hooks/useAccountId';
|
||||
import { languages } from '@/flavours/glitch/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,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user