expanded fix

pull/4346/head
filip mertens 12 months ago
parent 1bbe4bbcaf
commit 068282935c
  1. 1
      apps/remix-ide/src/app/panels/file-panel.js
  2. 5
      libs/remix-ui/workspace/src/lib/actions/events.ts

@ -234,7 +234,6 @@ module.exports = class Filepanel extends ViewPlugin {
} }
isExpanded(path) { isExpanded(path) {
console.log('isExpanded', path, this.expandPath)
if(path === '/') return true if(path === '/') return true
return this.expandPath.includes(path) return this.expandPath.includes(path)
} }

@ -175,11 +175,13 @@ const removePluginActions = (plugin, cb: (err: Error, result?: string | number |
} }
const fileAdded = async (filePath: string) => { const fileAdded = async (filePath: string) => {
/*
const path = extractParentFromKey(filePath) || ROOT_PATH const path = extractParentFromKey(filePath) || ROOT_PATH
console.log('fileAdded', filePath, path) console.log('fileAdded', filePath, path)
const isExpanded = await plugin.call('filePanel', 'isExpanded', path) const isExpanded = await plugin.call('filePanel', 'isExpanded', path)
if(!isExpanded) return if(!isExpanded) return
*/
await dispatch(fileAddedSuccess(filePath)) await dispatch(fileAddedSuccess(filePath))
if (filePath.includes('_test.sol')) { if (filePath.includes('_test.sol')) {
@ -190,13 +192,14 @@ const fileAdded = async (filePath: string) => {
const folderAdded = async (folderPath: string) => { const folderAdded = async (folderPath: string) => {
const provider = plugin.fileManager.currentFileProvider() const provider = plugin.fileManager.currentFileProvider()
const path = extractParentFromKey(folderPath) || ROOT_PATH const path = extractParentFromKey(folderPath) || ROOT_PATH
/*
const isExpanded = await plugin.call('filePanel', 'isExpanded', path) const isExpanded = await plugin.call('filePanel', 'isExpanded', path)
console.log('folderAdded', folderPath, path, isExpanded) console.log('folderAdded', folderPath, path, isExpanded)
if(!isExpanded) return if(!isExpanded) return
*/
const promise: Promise<FileTree> = new Promise((resolve) => { const promise: Promise<FileTree> = new Promise((resolve) => {
provider.resolveDirectory(path, (error, fileTree: FileTree) => { provider.resolveDirectory(path, (error, fileTree: FileTree) => {
if (error) console.error(error) if (error) console.error(error)

Loading…
Cancel
Save