mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 01:15:44 +01:00
solve reloading problem
This commit is contained in:
@@ -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);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user