Improve Redux types part 5/Replace DispatchFunc (#26004)

* Remove non-functional code from Login component

* Remove remaining usage of useDispatch<DispatchFunc>

* Remove usage of DispatchFunc from actions/file_actions

* actions/global_actions

* Remove usage of DispatchFunc from actions/marketplace

* Remove DispatchFunc from actions/post_actions

* Remove DispatchFunc from actions/storage

* Remove DispatchFunc from actions/user_actions

* Remove DispatchFunc from actions/views/channel

* Remove DispatchFunc from actions/views/channel_sidebar

* Remove DispatchFunc from actions/views/create_comment

* Remove DispatchFunc from actions/views/lhs.ts

* Remove DispatchFunc from actions/views/rhs.ts

* Remove DispatchFunc from actions/views/onboarding_tasks

* Remove DispatchFunc from actions/views/root

* Remove DispatchFunc from components/logged_in

* Remove DispatchFunc from components/msg_typing

* Remove DispatchFunc from components/permalink_view

* Remove DispatchFunc from components/suggestion

* Remove DispatchFunc from mattermost-redux/actions/posts

* Remove DispatchFunc from mattermost-redux/actions/roles

* Remove DispatchFunc from mattermost-redux/actions/threads

* Remove DispatchFunc from mattermost-redux/actions/timezone

* Remove DispatchFunc from plugins/products

* Make DispatchFunc into Dispatch

* Fix how dispatch is mocked in test for toggleSideBarRightMenuAction
Этот коммит содержится в:
Harrison Healey
2024-01-24 10:28:38 -05:00
коммит произвёл GitHub
родитель d8e11fe292
Коммит 8e165c7685
72 изменённых файлов: 450 добавлений и 539 удалений

Просмотреть файл

@@ -8,7 +8,6 @@ import {useDispatch} from 'react-redux';
import {GenericModal} from '@mattermost/components';
import type {DispatchFunc} from 'mattermost-redux/types/actions';
import {isEmail} from 'mattermost-redux/utils/helpers';
import {validateBusinessEmail} from 'actions/cloud';
@@ -36,7 +35,7 @@ const RequestBusinessEmailModal = (
onExited,
}: Props): JSX.Element | null => {
const {formatMessage} = useIntl();
const dispatch = useDispatch<DispatchFunc>();
const dispatch = useDispatch();
const [email, setEmail] = useState<string>('');
const [customInputLabel, setCustomInputLabel] = useState<CustomMessageInputType>(null);
const [trialBtnDisabled, setTrialBtnDisabled] = useState<boolean>(true);