Fix folder name extraction functions

It should return empty string if there is no parent folder.
This commit is contained in:
Vladimir Golovnev (Glassez)
2020-12-17 21:23:31 +03:00
parent 70b242f190
commit 79048812e9
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ window.qBittorrent.Filesystem = (function() {
const folderName = function(filepath) {
const slashIndex = filepath.lastIndexOf(PathSeparator);
if (slashIndex === -1)
return filepath;
return '';
return filepath.substring(0, slashIndex);
};