From b633a22540f255b3c70e739f2dee07dacfb43a79 Mon Sep 17 00:00:00 2001
From: Fin Reinhard <fin.reinhard@icloud.com>
Date: Fri, 25 Jan 2019 12:24:03 +0000
Subject: [PATCH] fixing force step into when going back
---
borgbutler-webapp/src/components/views/archives/FileListPanel.jsx | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx b/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
index b73031c..05a8879 100644
--- a/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
+++ b/borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
@@ -1,5 +1,5 @@
import React from 'react'
-import cookie from "react-cookies";
+import cookie from 'react-cookies';
import {withRouter} from 'react-router-dom';
import {Breadcrumb, Button} from 'reactstrap';
import {getRestServiceUrl} from '../../../utilities/global';
@@ -30,7 +30,8 @@
diffArchiveId: '',
autoChangeDirectoryToLeafItem: true,
openDownloads: true
- }
+ },
+ forceStepIntoDir: false
};
// Resetting the NoReFetch State
if (props.location.state) {
@@ -56,8 +57,20 @@
this.unregisterHistoryListener();
}
- handleURLChange = location => {
- if (location.state && location.state.noReFetch) {
+ handleURLChange = (location, action) => {
+
+ // When Action is going back and the last step was a force step go one extra
+ if (action === 'POP' && this.state.forceStepIntoDir) {
+ this.props.history.go(-1);
+ this.setState({forceStepIntoDir: false});
+ return;
+ }
+
+ const noReFetch = location.state && location.state.noReFetch;
+
+ this.setState({forceStepIntoDir: noReFetch});
+
+ if (noReFetch) {
return;
}
--
Gitblit v1.10.0