Merge branch 'fix-account-search' into 'develop'
Use account selector in Search input See merge request soapbox-pub/soapbox!2634
This commit is contained in:
commit
40fde3fc2c
2 changed files with 4 additions and 5 deletions
|
@ -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'),
|
||||
|
|
|
@ -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}`);
|
||||
|
|
Loading…
Reference in a new issue