TypeScript: actions

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2022-06-10 19:56:22 +02:00
parent 58539146a4
commit 708c3a9e64
27 changed files with 188 additions and 214 deletions

View File

@@ -1,6 +1,6 @@
import classNames from 'classnames';
import React from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { FormattedMessage } from 'react-intl';
import { useDispatch } from 'react-redux';
import { Link } from 'react-router-dom';
@@ -27,11 +27,10 @@ const LinkFooter: React.FC = (): JSX.Element => {
const features = useFeatures();
const soapboxConfig = useSoapboxConfig();
const intl = useIntl();
const dispatch = useDispatch();
const onClickLogOut: React.EventHandler<React.MouseEvent> = (e) => {
dispatch(logOut(intl));
dispatch(logOut());
e.preventDefault();
};

View File

@@ -44,7 +44,7 @@ const Navbar = () => {
event.preventDefault();
setLoading(true);
dispatch(logIn(intl, username, password) as any)
dispatch(logIn(username, password) as any)
.then(({ access_token }: { access_token: string }) => {
setLoading(false);

View File

@@ -43,7 +43,7 @@ const ProfileDropdown: React.FC<IProfileDropdown> = ({ account, children }) => {
const otherAccounts = useAppSelector((state) => authUsers.map((authUser: any) => getAccount(state, authUser.get('id'))));
const handleLogOut = () => {
dispatch(logOut(intl));
dispatch(logOut());
};
const handleSwitchAccount = (account: AccountEntity) => {