Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(tutor-mode): Added CLI subdirectories #1706

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/files/modals/Modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Modals extends React.Component {
}

componentDidUpdate (prev) {
const { show, files, t, onShareLink, cliOptions } = this.props
const { show, files, t, onShareLink, cliOptions, root } = this.props

if (show === prev.show) {
return
Expand Down Expand Up @@ -141,7 +141,7 @@ class Modals extends React.Component {
this.setState({ readyToShow: true })
break
case CLI_TUTOR_MODE:
this.setState({ command: this.cliCommand(cliOptions, files) }, () => {
this.setState({ command: this.cliCommand(cliOptions, files, root) }, () => {
this.setState({ readyToShow: true })
})
break
Expand All @@ -158,7 +158,7 @@ class Modals extends React.Component {
}
}

cliCommand = (action, files) => {
cliCommand = (action, files, root) => {
let activeCid = ''
let fileName = ''
let isPinned = ''
Expand All @@ -177,6 +177,7 @@ class Modals extends React.Component {
case cliCmdKeys.ADD_DIRECTORY:
case cliCmdKeys.CREATE_NEW_DIRECTORY:
case cliCmdKeys.FROM_IPFS:
return cliCommandList[action](root.substr('/files'.length))
case cliCmdKeys.DELETE_FILE_FROM_IPFS:
return cliCommandList[action](path)
case cliCmdKeys.DOWNLOAD_OBJECT_COMMAND:
Expand Down