Change "My collections" path to /@username/collections (#38630)
This commit is contained in:
1 parent
ef4a583f54
commit
d6c0b93c85
8 files changed
+63
-33
No files matched your search
+5
-2
@@ -4,6 +4,8 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import { useHistory } from 'react-router';
|
||||
|
||||
import { useAccount } from '@/mastodon/hooks/useAccount';
|
||||
import { me } from '@/mastodon/initial_state';
|
||||
import { deleteCollection } from 'mastodon/reducers/slices/collections';
|
||||
import { useAppDispatch } from 'mastodon/store';
|
||||
|
||||
@@ -34,11 +36,12 @@ export const ConfirmDeleteCollectionModal: React.FC<
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
const history = useHistory();
|
||||
const { acct: currentUserName } = useAccount(me) ?? {};
|
||||
|
||||
const onConfirm = useCallback(() => {
|
||||
void dispatch(deleteCollection({ collectionId: id }));
|
||||
history.push('/collections');
|
||||
}, [dispatch, history, id]);
|
||||
history.push(`/@${currentUserName}/collections`);
|
||||
}, [dispatch, history, id, currentUserName]);
|
||||
|
||||
return (
|
||||
<ConfirmationModal
|
||||
|
||||
Reference in new issue
Block a user