Commit 3e0c62ae authored by ioedeveloper's avatar ioedeveloper

Use provider name in callback

parent 9fb30ce7
...@@ -26,7 +26,7 @@ module.exports = { ...@@ -26,7 +26,7 @@ module.exports = {
'Test Failed Import': function (browser: NightwatchBrowser) { 'Test Failed Import': function (browser: NightwatchBrowser) {
browser.addFile('Untitled3.sol', sources[2]['Untitled3.sol']) browser.addFile('Untitled3.sol', sources[2]['Untitled3.sol'])
.clickLaunchIcon('solidity') .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) { 'Test Github Import - from master branch': function (browser: NightwatchBrowser) {
......
...@@ -218,7 +218,7 @@ module.exports = class Filepanel extends ViewPlugin { ...@@ -218,7 +218,7 @@ module.exports = class Filepanel extends ViewPlugin {
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} }
}, 200) }, 10)
} }
} }
} }
......
...@@ -183,7 +183,7 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp ...@@ -183,7 +183,7 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
if (provider) { if (provider) {
provider.event.register('fileAdded', async (filePath) => { provider.event.register('fileAdded', async (filePath) => {
if (extractParentFromKey(filePath) === '/.workspaces') return if (extractParentFromKey(filePath) === '/.workspaces') return
const path = extractParentFromKey(filePath) || workspaceName const path = extractParentFromKey(filePath) || provider.workspace || provider.type || ''
const data = await fetchDirectoryContent(provider, path) const data = await fetchDirectoryContent(provider, path)
dispatch(fileAddedSuccess(path, data)) dispatch(fileAddedSuccess(path, data))
...@@ -193,18 +193,18 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp ...@@ -193,18 +193,18 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
}) })
provider.event.register('folderAdded', async (folderPath) => { provider.event.register('folderAdded', async (folderPath) => {
if (extractParentFromKey(folderPath) === '/.workspaces') return if (extractParentFromKey(folderPath) === '/.workspaces') return
const path = extractParentFromKey(folderPath) || workspaceName const path = extractParentFromKey(folderPath) || provider.workspace || provider.type || ''
const data = await fetchDirectoryContent(provider, path) const data = await fetchDirectoryContent(provider, path)
dispatch(folderAddedSuccess(path, data)) dispatch(folderAddedSuccess(path, data))
}) })
provider.event.register('fileRemoved', async (removePath) => { provider.event.register('fileRemoved', async (removePath) => {
const path = extractParentFromKey(removePath) || workspaceName const path = extractParentFromKey(removePath) || provider.workspace || provider.type || ''
dispatch(fileRemovedSuccess(path, removePath)) dispatch(fileRemovedSuccess(path, removePath))
}) })
provider.event.register('fileRenamed', async (oldPath) => { 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) const data = await fetchDirectoryContent(provider, path)
dispatch(fileRenamedSuccess(path, oldPath, data)) dispatch(fileRenamedSuccess(path, oldPath, data))
...@@ -229,6 +229,7 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp ...@@ -229,6 +229,7 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
dispatch(displayNotification('File Renamed Failed', '', 'Ok', 'Cancel')) dispatch(displayNotification('File Renamed Failed', '', 'Ok', 'Cancel'))
}) })
provider.event.register('rootFolderChanged', async () => { provider.event.register('rootFolderChanged', async () => {
workspaceName = provider.workspace || provider.type || ''
fetchDirectory(provider, workspaceName)(dispatch) fetchDirectory(provider, workspaceName)(dispatch)
}) })
dispatch(fetchProviderSuccess(provider)) dispatch(fetchProviderSuccess(provider))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment