Use provider name in callback

pull/1140/head
ioedeveloper 4 years ago
parent 9fb30ce775
commit 3e0c62ae6f
  1. 2
      apps/remix-ide-e2e/src/tests/solidityImport.spec.ts
  2. 2
      apps/remix-ide/src/app/panels/file-panel.js
  3. 9
      libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts

@ -26,7 +26,7 @@ module.exports = {
'Test Failed Import': function (browser: NightwatchBrowser) {
browser.addFile('Untitled3.sol', sources[2]['Untitled3.sol'])
.clickLaunchIcon('solidity')
.assert.containsText('#compileTabView .error pre', 'not found default_workspace/Untitled11.sol')
.assert.containsText('#compileTabView .error pre', 'not found Untitled11.sol')
},
'Test Github Import - from master branch': function (browser: NightwatchBrowser) {

@ -218,7 +218,7 @@ module.exports = class Filepanel extends ViewPlugin {
} catch (error) {
console.error(error)
}
}, 200)
}, 10)
}
}
}

@ -183,7 +183,7 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
if (provider) {
provider.event.register('fileAdded', async (filePath) => {
if (extractParentFromKey(filePath) === '/.workspaces') return
const path = extractParentFromKey(filePath) || workspaceName
const path = extractParentFromKey(filePath) || provider.workspace || provider.type || ''
const data = await fetchDirectoryContent(provider, path)
dispatch(fileAddedSuccess(path, data))
@ -193,18 +193,18 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
})
provider.event.register('folderAdded', async (folderPath) => {
if (extractParentFromKey(folderPath) === '/.workspaces') return
const path = extractParentFromKey(folderPath) || workspaceName
const path = extractParentFromKey(folderPath) || provider.workspace || provider.type || ''
const data = await fetchDirectoryContent(provider, path)
dispatch(folderAddedSuccess(path, data))
})
provider.event.register('fileRemoved', async (removePath) => {
const path = extractParentFromKey(removePath) || workspaceName
const path = extractParentFromKey(removePath) || provider.workspace || provider.type || ''
dispatch(fileRemovedSuccess(path, removePath))
})
provider.event.register('fileRenamed', async (oldPath) => {
const path = extractParentFromKey(oldPath) || workspaceName
const path = extractParentFromKey(oldPath) || provider.workspace || provider.type || ''
const data = await fetchDirectoryContent(provider, path)
dispatch(fileRenamedSuccess(path, oldPath, data))
@ -229,6 +229,7 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
dispatch(displayNotification('File Renamed Failed', '', 'Ok', 'Cancel'))
})
provider.event.register('rootFolderChanged', async () => {
workspaceName = provider.workspace || provider.type || ''
fetchDirectory(provider, workspaceName)(dispatch)
})
dispatch(fetchProviderSuccess(provider))

Loading…
Cancel
Save