mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
fetch index resources at logout
This commit is contained in:
@@ -11,13 +11,14 @@ import {
|
|||||||
getLogoutFailure
|
getLogoutFailure
|
||||||
} from "../modules/auth";
|
} from "../modules/auth";
|
||||||
import { Loading, ErrorPage } from "@scm-manager/ui-components";
|
import { Loading, ErrorPage } from "@scm-manager/ui-components";
|
||||||
import { getLogoutLink } from "../modules/indexResource";
|
import { fetchIndexResources, getLogoutLink } from "../modules/indexResource";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
authenticated: boolean,
|
authenticated: boolean,
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
error: Error,
|
error: Error,
|
||||||
logoutLink: string,
|
logoutLink: string,
|
||||||
|
fetchIndexResources: () => void,
|
||||||
|
|
||||||
// dispatcher functions
|
// dispatcher functions
|
||||||
logout: (link: string) => void,
|
logout: (link: string) => void,
|
||||||
@@ -29,6 +30,7 @@ type Props = {
|
|||||||
class Logout extends React.Component<Props> {
|
class Logout extends React.Component<Props> {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.logout(this.props.logoutLink);
|
this.props.logout(this.props.logoutLink);
|
||||||
|
this.props.fetchIndexResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -64,7 +66,8 @@ const mapStateToProps = state => {
|
|||||||
|
|
||||||
const mapDispatchToProps = dispatch => {
|
const mapDispatchToProps = dispatch => {
|
||||||
return {
|
return {
|
||||||
logout: (link: string) => dispatch(logout(link))
|
logout: (link: string) => dispatch(logout(link)),
|
||||||
|
fetchIndexResources: () => dispatch(fetchIndexResources())
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user