mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 05:55:44 +01:00
Fix formatting
This commit is contained in:
@@ -27,7 +27,7 @@ type Props = WithTranslation & {
|
|||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
stoppableUpdateHandler?: number;
|
stoppableUpdateHandler?: number;
|
||||||
}
|
};
|
||||||
|
|
||||||
const FixedWidthTh = styled.th`
|
const FixedWidthTh = styled.th`
|
||||||
width: 16px;
|
width: 16px;
|
||||||
@@ -46,7 +46,6 @@ export function findParent(path: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FileTree extends React.Component<Props, State> {
|
class FileTree extends React.Component<Props, State> {
|
||||||
|
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {};
|
this.state = {};
|
||||||
@@ -54,10 +53,10 @@ class FileTree extends React.Component<Props, State> {
|
|||||||
|
|
||||||
componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<State>): void {
|
componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<State>): void {
|
||||||
if (prevState.stoppableUpdateHandler === this.state.stoppableUpdateHandler) {
|
if (prevState.stoppableUpdateHandler === this.state.stoppableUpdateHandler) {
|
||||||
const {tree, updateSources} = this.props;
|
const { tree, updateSources } = this.props;
|
||||||
if (tree?._embedded?.children && tree._embedded.children.find(c => c.partialResult)) {
|
if (tree?._embedded?.children && tree._embedded.children.find(c => c.partialResult)) {
|
||||||
const stoppableUpdateHandler = setTimeout(updateSources, 3000);
|
const stoppableUpdateHandler = setTimeout(updateSources, 3000);
|
||||||
this.setState({stoppableUpdateHandler: stoppableUpdateHandler});
|
this.setState({ stoppableUpdateHandler: stoppableUpdateHandler });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -177,5 +176,8 @@ const mapStateToProps = (state: any, ownProps: Props) => {
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withRouter,
|
withRouter,
|
||||||
connect(mapStateToProps, mapDispatchToProps)
|
connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)
|
||||||
)(withTranslation("repos")(FileTree));
|
)(withTranslation("repos")(FileTree));
|
||||||
|
|||||||
@@ -9,16 +9,13 @@ export const FETCH_SOURCES_PENDING = `${FETCH_SOURCES}_${types.PENDING_SUFFIX}`;
|
|||||||
export const FETCH_SOURCES_SUCCESS = `${FETCH_SOURCES}_${types.SUCCESS_SUFFIX}`;
|
export const FETCH_SOURCES_SUCCESS = `${FETCH_SOURCES}_${types.SUCCESS_SUFFIX}`;
|
||||||
export const FETCH_SOURCES_FAILURE = `${FETCH_SOURCES}_${types.FAILURE_SUFFIX}`;
|
export const FETCH_SOURCES_FAILURE = `${FETCH_SOURCES}_${types.FAILURE_SUFFIX}`;
|
||||||
|
|
||||||
export function fetchSources(
|
`export function fetchSources(repository: Repository, revision: string, path: string, initialLoad = true) {
|
||||||
repository: Repository,
|
|
||||||
revision: string,
|
|
||||||
path: string,
|
|
||||||
initialLoad = true
|
|
||||||
) {
|
|
||||||
return function(dispatch: any, getState: () => any) {
|
return function(dispatch: any, getState: () => any) {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
if (isFetchSourcesPending(state, repository, revision, path)
|
if (
|
||||||
|| isUpdateSourcePending(state, repository, revision, path)) {
|
isFetchSourcesPending(state, repository, revision, path) ||
|
||||||
|
isUpdateSourcePending(state, repository, revision, path)
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,10 +54,15 @@ export function fetchSourcesPending(repository: Repository, revision: string, pa
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateSourcesPending(repository: Repository, revision: string, path: string, currentSources: any): Action {
|
export function updateSourcesPending(
|
||||||
|
repository: Repository,
|
||||||
|
revision: string,
|
||||||
|
path: string,
|
||||||
|
currentSources: any
|
||||||
|
): Action {
|
||||||
return {
|
return {
|
||||||
type: "UPDATE_PENDING",
|
type: "UPDATE_PENDING",
|
||||||
payload: { updatePending: true, sources: currentSources},
|
payload: { updatePending: true, sources: currentSources },
|
||||||
itemId: createItemId(repository, revision, path)
|
itemId: createItemId(repository, revision, path)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user