Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
c991d4ab
Commit
c991d4ab
authored
Apr 30, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failing tests
parent
0cfab431
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
file-panel.js
apps/remix-ide/src/app/panels/file-panel.js
+7
-5
fileSystem.ts
libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
+2
-2
No files found.
apps/remix-ide/src/app/panels/file-panel.js
View file @
c991d4ab
...
...
@@ -209,11 +209,13 @@ module.exports = class Filepanel extends ViewPlugin {
workspaceProvider
.
setWorkspace
(
workspaceName
)
await
this
.
request
.
setWorkspace
(
workspaceName
)
// tells the react component to switch to that workspace
for
(
const
file
in
examples
)
{
try
{
await
workspaceProvider
.
set
(
examples
[
file
].
name
,
examples
[
file
].
content
)
}
catch
(
error
)
{
console
.
error
(
error
)
}
setTimeout
(
async
()
=>
{
// space creation of files to give react ui time to update.
try
{
await
workspaceProvider
.
set
(
examples
[
file
].
name
,
examples
[
file
].
content
)
}
catch
(
error
)
{
console
.
error
(
error
)
}
},
200
)
}
}
}
...
...
libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
View file @
c991d4ab
...
...
@@ -182,7 +182,7 @@ export const fileRenamedSuccess = (path: string, removePath: string, files) => {
export
const
init
=
(
provider
,
workspaceName
:
string
,
plugin
,
registry
)
=>
(
dispatch
:
React
.
Dispatch
<
any
>
)
=>
{
if
(
provider
)
{
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
)
dispatch
(
fileAddedSuccess
(
path
,
data
))
...
...
@@ -191,7 +191,7 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
}
})
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
)
dispatch
(
folderAddedSuccess
(
path
,
data
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment