From 28456794ec17181758f55e67f744ab2bbe4cf82d Mon Sep 17 00:00:00 2001
From: Fin Reinhard <fin.reinhard@icloud.com>
Date: Thu, 24 Jan 2019 22:19:24 +0000
Subject: [PATCH] fixing url step into sub dirs

---
 borgbutler-webapp/src/components/views/archives/FileListPanel.jsx |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx b/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
index db75927..3e5f0cd 100644
--- a/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
+++ b/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
@@ -96,11 +96,17 @@
             .then(json => {
                 let currentDirectory = this.state.filter.currentDirectory;
                 const fileList = json;
-                if (fileList && fileList.length === 1 && fileList[0] && fileList[0].path) {
+                if (fileList && fileList.length > 0 && fileList[0] && fileList[0].path) {
                     currentDirectory = fileList[0].path.replace(fileList[0].displayPath, '');
-                    const newUrl = `${this.props.match.url}/${fileList[0].path}/`;
+
+                    let newUrl = this.props.match.url;
+
+                    if (currentDirectory) {
+                        newUrl += `/${currentDirectory}`;
+                    }
+
                     if (newUrl !== this.props.location.pathname) {
-                        this.props.history.push(`${this.props.match.url}/${fileList[0].path}/`);
+                        this.props.history.push(newUrl);
                     }
                 }
                 this.setState({

--
Gitblit v1.10.0