fixed employee not logged out when user logs out
This commit is contained in:
@@ -4,20 +4,22 @@ import { Button } from "react-native";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { signOutStart } from "../../redux/user/user.actions";
|
||||
import { employeeSignOut } from "../../redux/employee/employee.actions";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
signOutStart: () => dispatch(signOutStart()),
|
||||
signOut: () => dispatch(employeeSignOut()),
|
||||
});
|
||||
|
||||
export function SignOutButton({ signOutStart }) {
|
||||
export function SignOutButton({ signOutStart, signOut }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Button
|
||||
style={{ margin: 8 }}
|
||||
onPress={() => signOutStart()}
|
||||
onPress={() => (signOut(),signOutStart())}
|
||||
title={t("general.actions.signout")}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user