Fixed failing tests

pull/1140/head
ioedeveloper 4 years ago
parent 0cfab431e5
commit c991d4ab95
  1. 12
      apps/remix-ide/src/app/panels/file-panel.js
  2. 4
      libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts

@ -209,11 +209,13 @@ module.exports = class Filepanel extends ViewPlugin {
workspaceProvider.setWorkspace(workspaceName) workspaceProvider.setWorkspace(workspaceName)
await this.request.setWorkspace(workspaceName) // tells the react component to switch to that workspace await this.request.setWorkspace(workspaceName) // tells the react component to switch to that workspace
for (const file in examples) { for (const file in examples) {
try { setTimeout(async () => { // space creation of files to give react ui time to update.
await workspaceProvider.set(examples[file].name, examples[file].content) try {
} catch (error) { await workspaceProvider.set(examples[file].name, examples[file].content)
console.error(error) } catch (error) {
} console.error(error)
}
}, 200)
} }
} }
} }

@ -182,7 +182,7 @@ export const fileRenamedSuccess = (path: string, removePath: string, files) => {
export const init = (provider, workspaceName: string, plugin, registry) => (dispatch: React.Dispatch<any>) => { export const init = (provider, workspaceName: string, plugin, registry) => (dispatch: React.Dispatch<any>) => {
if (provider) { if (provider) {
provider.event.register('fileAdded', async (filePath) => { provider.event.register('fileAdded', async (filePath) => {
const path = extractParentFromKey(filePath) || workspaceName const path = extractParentFromKey(filePath) ? extractParentFromKey(filePath) === '/.workspaces' ? workspaceName : extractParentFromKey(filePath) : workspaceName
const data = await fetchDirectoryContent(provider, path) const data = await fetchDirectoryContent(provider, path)
dispatch(fileAddedSuccess(path, data)) dispatch(fileAddedSuccess(path, data))
@ -191,7 +191,7 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
} }
}) })
provider.event.register('folderAdded', async (folderPath) => { provider.event.register('folderAdded', async (folderPath) => {
const path = extractParentFromKey(folderPath) || workspaceName const path = extractParentFromKey(folderPath) ? extractParentFromKey(folderPath) === '/.workspaces' ? workspaceName : extractParentFromKey(folderPath) : workspaceName
const data = await fetchDirectoryContent(provider, path) const data = await fetchDirectoryContent(provider, path)
dispatch(folderAddedSuccess(path, data)) dispatch(folderAddedSuccess(path, data))

Loading…
Cancel
Save