Skip to content

Commit cf2014b

Browse files
authored
Merge pull request #350 from nexB/347-fix-dashboard-file-counts
Dashboard now correctly lists number of files scanned #347
2 parents 7481046 + c2bd247 commit cf2014b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

assets/app/js/controllers/dashboard.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,11 @@ class Dashboard extends Controller {
118118
this.totalFilesProgressbar.showIndeterminate();
119119
this.db().sync
120120
.then((db) => db.File.findOne({where: {path: this.selectedPath()}}))
121-
.then((row) => this.totalFilesScanned.text(row ? row.files_count : '0'))
122-
.then(() => this.totalFilesProgressbar.hide());
121+
.then((row) => {
122+
const files_count = row.type === 'directory' ? row.files_count : 1;
123+
this.totalFilesScanned.text(files_count);
124+
this.totalFilesProgressbar.hide();
125+
});
123126

124127
// Get total unique licenses detected at a certain path
125128
this.uniqueLicensesProgressbar.showIndeterminate();

0 commit comments

Comments
 (0)