From bc140b98802a4aad9af8fbb7182a637677506233 Mon Sep 17 00:00:00 2001
From: Fin Reinhard <fin.reinhard@icloud.com>
Date: Thu, 24 Jan 2019 22:02:25 +0000
Subject: [PATCH] changing url when steping into multiple sub directories
---
borgbutler-webapp/src/components/views/archives/FileListPanel.jsx | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx b/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
index 698d7d4..db75927 100644
--- a/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
+++ b/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
@@ -96,9 +96,12 @@
.then(json => {
let currentDirectory = this.state.filter.currentDirectory;
const fileList = json;
- if (fileList && fileList.length > 0 && fileList[0] && fileList[0].path) {
+ if (fileList && fileList.length === 1 && fileList[0] && fileList[0].path) {
currentDirectory = fileList[0].path.replace(fileList[0].displayPath, '');
- console.log("path=" + fileList[0].path + ", displayPath=" + fileList[0].displayPath + "-> currentDirectory=" + currentDirectory)
+ const newUrl = `${this.props.match.url}/${fileList[0].path}/`;
+ if (newUrl !== this.props.location.pathname) {
+ this.props.history.push(`${this.props.match.url}/${fileList[0].path}/`);
+ }
}
this.setState({
isFetching: false,
--
Gitblit v1.10.0