Skynet export fixes

This commit is contained in:
2020-06-23 15:18:13 -05:00
parent e7978e335b
commit d1ed8706fd
3 changed files with 25 additions and 2 deletions

View File

@@ -70,7 +70,13 @@ const _createTreeNodes = fileList => {
};
const addNode = obj => {
const fullPath = path.join(obj.directory, obj.filename).replace(/\\/g, '/');
let fullPath;
const idx = obj.skylink.indexOf('/');
if (idx > -1) {
fullPath = path.join(obj.directory, obj.skylink.substr(idx + 1)).replace(/\\/g, '/');
} else {
fullPath = path.join(obj.directory, obj.filename).replace(/\\/g, '/');
}
const pathParts = fullPath.replace(/^\/|\/$/g, '').split('/');
let ptr = tree;
for (let i = 0; i < pathParts.length; i++) {