Merge branch 'fix-account-search' into 'develop'

Use account selector in Search input

See merge request soapbox-pub/soapbox!2634
environments/review-develop-3zknud/deployments/3698
marcin mikołajczak 2023-07-30 14:07:53 +00:00
commit 40fde3fc2c
2 zmienionych plików z 4 dodań i 5 usunięć

Wyświetl plik

@ -116,8 +116,7 @@ const deleteUserModal = (intl: IntlShape, accountId: string, afterConfirm = () =
const toggleStatusSensitivityModal = (intl: IntlShape, statusId: string, sensitive: boolean, afterConfirm = () => {}) =>
(dispatch: AppDispatch, getState: () => RootState) => {
const state = getState();
const accountId = state.statuses.get(statusId)!.account.id;
const acct = selectAccount(state, accountId)!.acct;
const acct = state.statuses.get(statusId)!.account.acct;
dispatch(openModal('CONFIRM', {
icon: require('@tabler/icons/alert-triangle.svg'),
@ -137,8 +136,7 @@ const toggleStatusSensitivityModal = (intl: IntlShape, statusId: string, sensiti
const deleteStatusModal = (intl: IntlShape, statusId: string, afterConfirm = () => {}) =>
(dispatch: AppDispatch, getState: () => RootState) => {
const state = getState();
const accountId = state.statuses.get(statusId)!.account.id;
const acct = selectAccount(state, accountId)!.acct;
const acct = state.statuses.get(statusId)!.account.acct;
dispatch(openModal('CONFIRM', {
icon: require('@tabler/icons/trash.svg'),

Wyświetl plik

@ -16,6 +16,7 @@ import AutosuggestAccountInput from 'soapbox/components/autosuggest-account-inpu
import { Input } from 'soapbox/components/ui';
import SvgIcon from 'soapbox/components/ui/icon/svg-icon';
import { useAppDispatch, useAppSelector } from 'soapbox/hooks';
import { selectAccount } from 'soapbox/selectors';
import { AppDispatch, RootState } from 'soapbox/store';
const messages = defineMessages({
@ -25,7 +26,7 @@ const messages = defineMessages({
function redirectToAccount(accountId: string, routerHistory: any) {
return (_dispatch: AppDispatch, getState: () => RootState) => {
const acct = getState().getIn(['accounts', accountId, 'acct']);
const acct = selectAccount(getState(), accountId)!.acct;
if (acct && routerHistory) {
routerHistory.push(`/@${acct}`);