diff --git a/src/App.js b/src/App.js
index ea7beae..7d94762 100644
--- a/src/App.js
+++ b/src/App.js
@@ -238,9 +238,6 @@ class App extends Component {
if (browserFs === null) browserFs = ["", ""]
if (currentPath === null) currentPath = ["/", "/"]
- browserFs[0] = name
- currentPath[0] = "/"
-
sessionStorage.setItem("browserFs", JSON.stringify(browserFs))
sessionStorage.setItem("currentPath", JSON.stringify(currentPath))
diff --git a/src/assets/icons/browserDual.svg b/src/assets/icons/browserDual.svg
new file mode 100644
index 0000000..37c0292
--- /dev/null
+++ b/src/assets/icons/browserDual.svg
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/src/assets/icons/browserSingle.svg b/src/assets/icons/browserSingle.svg
new file mode 100644
index 0000000..a7901b6
--- /dev/null
+++ b/src/assets/icons/browserSingle.svg
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/src/components/fileBrowserMenu.jsx b/src/components/fileBrowserMenu.jsx
index a15edb3..8674d0b 100644
--- a/src/components/fileBrowserMenu.jsx
+++ b/src/components/fileBrowserMenu.jsx
@@ -2,9 +2,12 @@ import React, { Component } from 'react'
import { Button, Cross, PopupContainer, PopupTitle } from '../styled'
import API from '../utils/API'
import FileBrowser from './fileBrowser'
-import { FileBrowserRemotes, FileBrowsersContainer, FileBrowserWrapper } from './fileBrowser.styled'
+import { BrowserSettingButton, FileBrowserRemotes, FileBrowsersContainer, FileBrowserSettings, FileBrowserWrapper } from './fileBrowser.styled'
import assert from 'assert'
+import BrowserSingle from '../assets/icons/browserSingle.svg'
+import BrowserDual from '../assets/icons/browserDual.svg'
+
class FileBrowserMenu extends Component {
constructor() {
super()
@@ -21,7 +24,8 @@ class FileBrowserMenu extends Component {
browserFs: ["", ""],
loading: [false, false],
errMessage: "",
- dualBrowser: false
+ dualBrowser: false,
+ activeBrowser: -1
}
}
@@ -33,6 +37,7 @@ class FileBrowserMenu extends Component {
setTimeout(() => {
this.getFiles(0, currentPath[0])
+ .catch(() => {})
}, 50)
}
@@ -111,6 +116,15 @@ class FileBrowserMenu extends Component {
})
}
+ switchBrowserMode = () => {
+ if (this.state.dualBrowser) return this.setState({ activeBrowser: -1, dualBrowser: false })
+ return this.setState({ activeBrowser: 1, dualBrowser: true })
+ }
+
+ setActiveBrowser = activeBrowser => {
+ if (this.state.dualBrowser) this.setState({ activeBrowser })
+ }
+
setRemote = (brIndex, remoteName) => {
let { browserFs, currentPath } = this.state
browserFs[brIndex] = remoteName
@@ -129,7 +143,7 @@ class FileBrowserMenu extends Component {
}
render = () => {
- const { files, currentPath, loading } = this.state
+ const { files, currentPath, loading, dualBrowser, activeBrowser } = this.state
return (
@@ -137,18 +151,38 @@ class FileBrowserMenu extends Component {
Close
-
-
- { this.renderRemoteButtons(0) }
-
+
+ { this.renderRemoteButtons(0) }
+
+
+
+
+
+
+
+
this.setActiveBrowser(0)}
action={(a, p) => this.doAction(0, a, p)}
files={files[0]}
updateFiles={path => this.getFiles(0, path)}
currentPath={currentPath[0]}
loading={loading[0]}
+ active={activeBrowser === 0}
/>
+ {
+ dualBrowser &&
+ this.setActiveBrowser(1)}
+ action={(a, p) => this.doAction(1, a, p)}
+ files={files[1]}
+ updateFiles={path => this.getFiles(1, path)}
+ currentPath={currentPath[1]}
+ loading={loading[1]}
+ active={activeBrowser === 1}
+ />
+ }