Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #377 from Lukx/master

Network Graph: AjaxLoader & Error Handling for no-more-entries
  • Loading branch information...
commit 5fd33a90edc9cc66894e98efe9acf2ff059bfce0 2 parents d5d4509 + 0ea9d0d
@klaussilveira authored
View
13 src/GitList/Controller/NetworkController.php
@@ -55,6 +55,7 @@ function ($repo, $commitishPath, $page) use ($app) {
}
$nextPageUrl = null;
+
if ($pager['last'] !== $pager['current']) {
$nextPageUrl = $app['url_generator']->generate(
'networkData',
@@ -65,6 +66,18 @@ function ($repo, $commitishPath, $page) use ($app) {
)
);
}
+
+ // when no commits are given, return an empty response - issue #369
+ if( count($commits) === 0 ) {
+ return $app->json( array(
+ 'repo' => $repo,
+ 'commitishPath' => $commitishPath,
+ 'nextPage' => null,
+ 'start' => null,
+ 'commits' => $jsonFormattedCommits
+ ), 200
+ );
+ }
return $app->json( array(
'repo' => $repo,
View
BIN  web/img/ajax-loader.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  web/js/networkGraph.js
@@ -351,7 +351,7 @@
}
function handleNoAvailableData() {
- console.log('No Data available');
+ window.console && console.log('No (more) Data available');
}
var awaitedParents = {};
Please sign in to comment.
Something went wrong with that request. Please try again.