diff --git a/scm-ui/ui-webapp/src/repos/sources/components/FileTree.tsx b/scm-ui/ui-webapp/src/repos/sources/components/FileTree.tsx index 7983fdd32e..fee6f985cd 100644 --- a/scm-ui/ui-webapp/src/repos/sources/components/FileTree.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/components/FileTree.tsx @@ -27,7 +27,7 @@ type Props = WithTranslation & { type State = { stoppableUpdateHandler?: number; -} +}; const FixedWidthTh = styled.th` width: 16px; @@ -46,7 +46,6 @@ export function findParent(path: string) { } class FileTree extends React.Component { - constructor(props: Props) { super(props); this.state = {}; @@ -54,10 +53,10 @@ class FileTree extends React.Component { componentDidUpdate(prevProps: Readonly, prevState: Readonly): void { 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)) { 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( withRouter, - connect(mapStateToProps, mapDispatchToProps) + connect( + mapStateToProps, + mapDispatchToProps + ) )(withTranslation("repos")(FileTree)); diff --git a/scm-ui/ui-webapp/src/repos/sources/modules/sources.ts b/scm-ui/ui-webapp/src/repos/sources/modules/sources.ts index f976928e9f..8af2cc33cc 100644 --- a/scm-ui/ui-webapp/src/repos/sources/modules/sources.ts +++ b/scm-ui/ui-webapp/src/repos/sources/modules/sources.ts @@ -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_FAILURE = `${FETCH_SOURCES}_${types.FAILURE_SUFFIX}`; -export function fetchSources( - repository: Repository, - revision: string, - path: string, - initialLoad = true -) { +`export function fetchSources(repository: Repository, revision: string, path: string, initialLoad = true) { return function(dispatch: any, getState: () => any) { const state = getState(); - if (isFetchSourcesPending(state, repository, revision, path) - || isUpdateSourcePending(state, repository, revision, path)) { + if ( + isFetchSourcesPending(state, repository, revision, path) || + isUpdateSourcePending(state, repository, revision, path) + ) { 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 { type: "UPDATE_PENDING", - payload: { updatePending: true, sources: currentSources}, + payload: { updatePending: true, sources: currentSources }, itemId: createItemId(repository, revision, path) }; }