Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit 678aced

Browse files
committed
🐛 Fix #262 - Fallback to previous dir
1 parent 775b799 commit 678aced

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/classes/filesystem.class.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,14 @@ class FilesystemDisplay {
8282
fs.readdir(tcwd, (err, content) => {
8383
if (err !== null) {
8484
console.warn(err);
85-
this.setFailedState();
85+
if (this._noTracking === true && this.dirpath) { // #262
86+
this.setFailedState();
87+
setTimeout(() => {
88+
this.readFS(this.dirpath);
89+
}, 1000);
90+
} else {
91+
this.setFailedState();
92+
}
8693
} else {
8794
this.cwd = [];
8895
this._tmp = {
@@ -265,14 +272,14 @@ class FilesystemDisplay {
265272
</div>`;
266273
});
267274
this.filesContainer.innerHTML = filesDOM;
268-
275+
269276
// See #226
270277
if (!isNaN(this.fsBlock.use)) {
271278
this.space_bar.text.innerHTML = `Mount <strong>${this.fsBlock.mount}</strong> used <strong>${Math.round(this.fsBlock.use)}%</strong>`;
272279
this.space_bar.bar.value = Math.round(this.fsBlock.use);
273280
} else if (!isNaN((this.fsBlock.size / this.fsBlock.used) * 100)) {
274281
let usage = Math.round((this.fsBlock.size / this.fsBlock.used) * 100);
275-
282+
276283
this.space_bar.text.innerHTML = `Mount <strong>${this.fsBlock.mount}</strong> used <strong>${usage}%</strong>`;
277284
this.space_bar.bar.value = usage;
278285
} else {

0 commit comments

Comments
 (0)