From 789ff96cf043ea4920f7925d52fa6e06d4c2375e Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 20 Oct 2019 01:19:34 +0200 Subject: [PATCH] fix(core): update --- ts/smartbucket.classes.directory.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ts/smartbucket.classes.directory.ts b/ts/smartbucket.classes.directory.ts index dd48106..b97e76a 100644 --- a/ts/smartbucket.classes.directory.ts +++ b/ts/smartbucket.classes.directory.ts @@ -67,9 +67,12 @@ export class Directory { if(!bucketItem.name) { return; } - const subtractedPath = bucketItem.name.replace(this.getBasePath(), ''); + let subtractedPath = bucketItem.name.replace(this.getBasePath(), ''); + if (subtractedPath.startsWith('/')) { + subtractedPath = subtractedPath.substr(1); + } if (!subtractedPath.includes('/')) { - fileArray.push(new File(this, bucketItem.name)); + fileArray.push(new File(this, subtractedPath)); } },