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

Commit

Permalink
Don't refresh filesystem if path hasn't changed (#746)
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg authored Jul 11, 2020
1 parent 54ddb18 commit 1b60a87
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/classes/filesystem.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class FilesystemDisplay {
const fs = require("fs");
const path = require("path");
this.cwd = [];
this.cwd_path = null;
this.iconcolor = `rgb(${window.theme.r}, ${window.theme.g}, ${window.theme.b})`;
this._formatBytes = (a,b) => {if(0==a)return"0 Bytes";var c=1024,d=b||2,e=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],f=Math.floor(Math.log(a)/Math.log(c));return parseFloat((a/Math.pow(c,f)).toFixed(d))+" "+e[f]};
this.fileIconsMatcher = require("./assets/misc/file-icons-match.js");
Expand Down Expand Up @@ -101,7 +102,8 @@ class FilesystemDisplay {
// See #501
if (this._noTracking) return false;

if (cwd && window.currentTerm === num) {
if (cwd && cwd !== this.cwd_path && window.currentTerm === num) {
this.cwd_path = cwd;
if (this._fsWatcher) {
this._fsWatcher.close();
}
Expand Down

0 comments on commit 1b60a87

Please sign in to comment.