mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Fix loading detection
This commit is contained in:
@@ -105,7 +105,6 @@ class FileTree extends React.Component<Props, State> {
|
||||
return (
|
||||
<div className="panel-block">
|
||||
{this.renderSourcesTable()}
|
||||
{lastHunk.loading && <Loading />}
|
||||
{lastHunk.tree?.truncated && <Button label={t("sources.loadMore")} action={this.loadMore} />}
|
||||
</div>
|
||||
);
|
||||
@@ -124,6 +123,10 @@ class FileTree extends React.Component<Props, State> {
|
||||
});
|
||||
}
|
||||
|
||||
if (hunks.every(hunk => hunk.loading)) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
hunks
|
||||
.filter(hunk => !hunk.loading)
|
||||
.forEach(hunk => {
|
||||
@@ -144,6 +147,7 @@ class FileTree extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<table className="table table-hover table-sm is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -161,6 +165,8 @@ class FileTree extends React.Component<Props, State> {
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
{hunks[hunks.length - 1].loading && <Loading />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
return <Notification type="info">{t("sources.noSources")}</Notification>;
|
||||
@@ -185,7 +191,6 @@ const mapStateToProps = (state: any, ownProps: Props) => {
|
||||
const hunkCount = getHunkCount(state, repository, revision, path);
|
||||
const hunks = [];
|
||||
for (let i = 0; i < hunkCount; ++i) {
|
||||
console.log(`getting data for hunk ${i}`);
|
||||
const tree = getSources(state, repository, revision, path, i);
|
||||
const loading = isFetchSourcesPending(state, repository, revision, path, i);
|
||||
hunks.push({
|
||||
|
||||
Reference in New Issue
Block a user