solve reloading problem

This commit is contained in:
Maren Süwer
2018-10-11 11:40:04 +02:00
parent beaf301bc4
commit dd7a68fa02

View File

@@ -1,15 +1,10 @@
// @flow // @flow
import * as React from "react"; import * as React from "react";
import { apiClient, Loading } from "@scm-manager/ui-components"; import { apiClient, Loading } from "@scm-manager/ui-components";
import { import { callFetchIndexResources } from "../modules/indexResource";
callFetchIndexResources,
getUiPluginsLink
} from "../modules/indexResource";
import { connect } from "react-redux";
type Props = { type Props = {
children: React.Node, children: React.Node
link: string
}; };
type State = { type State = {
@@ -42,8 +37,8 @@ class PluginLoader extends React.Component<Props, State> {
}); });
} }
getPlugins = (link: string) => { getPlugins = (link: string): Promise<any> => {
apiClient return apiClient
.get(link) .get(link)
.then(response => response.text()) .then(response => response.text())
.then(JSON.parse) .then(JSON.parse)
@@ -101,14 +96,4 @@ class PluginLoader extends React.Component<Props, State> {
} }
} }
const mapStateToProps = state => { export default PluginLoader;
const link = getUiPluginsLink(state);
return {
link
};
};
export default connect(
mapStateToProps,
null
)(PluginLoader);