diff --git a/src/bundles/files/actions.js b/src/bundles/files/actions.js index bc8fb7716..482ba42f0 100644 --- a/src/bundles/files/actions.js +++ b/src/bundles/files/actions.js @@ -378,7 +378,7 @@ const actions = () => ({ * @param {string} src * @param {string} name */ - // HERE + doFilesAddPath: (root, src, name = '') => perform(ACTIONS.ADD_BY_PATH, async (ipfs, { store }) => { ensureMFS(store) @@ -405,9 +405,6 @@ const actions = () => ({ * @param {string} root - Destination directory in IPFS */ doFilesAddBulkCid: (source, root) => spawn(ACTIONS.ADD_BY_PATH, async function * (ipfs, { store }) { - console.log('Action parameters:', { source, root }) - console.log('Arguments:', arguments) - ensureMFS(store) // Ensure source is properly passed diff --git a/src/files/modals/bulk-import-modal/BulkImportModal.js b/src/files/modals/bulk-import-modal/BulkImportModal.js index 499f6a92f..2c586dfdf 100644 --- a/src/files/modals/bulk-import-modal/BulkImportModal.js +++ b/src/files/modals/bulk-import-modal/BulkImportModal.js @@ -19,8 +19,8 @@ class BulkImportModal extends React.Component { } state = { - path: '', - name: '', + // path: '', + // name: '', selectedFile: null } @@ -33,18 +33,8 @@ class BulkImportModal extends React.Component { } onChange = (event) => { - const target = event.target - const value = target.value - const name = target.name - this.setState({ [name]: value }) - } - - onBulkCidInputChange = (event) => { const files = event.target.files - console.log('files: ', files) this.setState({ selectedFile: files[0] }) - // console.log('input: ', input) - // this.setState({ selectedFile: input.files }) } selectFile = async () => { @@ -52,11 +42,9 @@ class BulkImportModal extends React.Component { } onSubmit = async () => { - console.log('BulkImportModal onSubmit:', this.state.selectedFile) if (this.state.selectedFile) { const normalizedFiles = normalizeFiles([this.state.selectedFile]) - console.log('Calling onBulkCidImport with:', { normalizedFiles, root: '/files' }) - await this.props.onBulkCidImport(normalizedFiles, '/files') + await this.props.onBulkCidImport(normalizedFiles) } } @@ -72,13 +60,9 @@ class BulkImportModal extends React.Component { return 'b--red-muted focus-outline-red' } - // get isDisabled () { - // if (this.state.path === '') { - // return true - // } - - // return !this.validatePath(this.state.path) - // } + get isDisabled () { + return !this.state.selectedFile + } render () { const { @@ -100,7 +84,7 @@ class BulkImportModal extends React.Component { className='dn' multiple accept='.txt' - onChange={this.onBulkCidInputChange} + onChange={this.onChange} // className='input-reset' // id='bulk-import' ref={el => { @@ -136,7 +120,7 @@ class BulkImportModal extends React.Component { - + )