diff --git a/app/soapbox/actions/moderation.tsx b/app/soapbox/actions/moderation.tsx index 62ffbfc9b..bdaebba5c 100644 --- a/app/soapbox/actions/moderation.tsx +++ b/app/soapbox/actions/moderation.tsx @@ -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'), diff --git a/app/soapbox/features/compose/components/search.tsx b/app/soapbox/features/compose/components/search.tsx index 87c0fa358..9bdc2c6b7 100644 --- a/app/soapbox/features/compose/components/search.tsx +++ b/app/soapbox/features/compose/components/search.tsx @@ -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}`);