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
9fb30ce7
Commit
9fb30ce7
authored
May 12, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for exists asynchronous check.
parent
e638250a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
file-panel.js
apps/remix-ide/src/app/panels/file-panel.js
+5
-2
fileSystem.ts
libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
+4
-2
No files found.
apps/remix-ide/src/app/panels/file-panel.js
View file @
9fb30ce7
...
...
@@ -188,8 +188,11 @@ module.exports = class Filepanel extends ViewPlugin {
const
browserProvider
=
this
.
_deps
.
fileProviders
.
browser
const
workspacePath
=
'browser/'
+
workspaceProvider
.
workspacesPath
+
'/'
+
name
const
workspaceRootPath
=
'browser/'
+
workspaceProvider
.
workspacesPath
if
(
!
browserProvider
.
exists
(
workspaceRootPath
))
browserProvider
.
createDir
(
workspaceRootPath
)
if
(
!
browserProvider
.
exists
(
workspacePath
))
browserProvider
.
createDir
(
workspacePath
)
const
workspaceRootPathExists
=
await
browserProvider
.
exists
(
workspaceRootPath
)
const
workspacePathExists
=
await
browserProvider
.
exists
(
workspacePath
)
if
(
!
workspaceRootPathExists
)
browserProvider
.
createDir
(
workspaceRootPath
)
if
(
!
workspacePathExists
)
browserProvider
.
createDir
(
workspacePath
)
}
async
workspaceExists
(
name
)
{
...
...
libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
View file @
9fb30ce7
...
...
@@ -182,7 +182,8 @@ 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
)
?
extractParentFromKey
(
filePath
)
===
'/.workspaces'
?
workspaceName
:
extractParentFromKey
(
filePath
)
:
workspaceName
if
(
extractParentFromKey
(
filePath
)
===
'/.workspaces'
)
return
const
path
=
extractParentFromKey
(
filePath
)
||
workspaceName
const
data
=
await
fetchDirectoryContent
(
provider
,
path
)
dispatch
(
fileAddedSuccess
(
path
,
data
))
...
...
@@ -191,7 +192,8 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
}
})
provider
.
event
.
register
(
'folderAdded'
,
async
(
folderPath
)
=>
{
const
path
=
extractParentFromKey
(
folderPath
)
?
extractParentFromKey
(
folderPath
)
===
'/.workspaces'
?
workspaceName
:
extractParentFromKey
(
folderPath
)
:
workspaceName
if
(
extractParentFromKey
(
folderPath
)
===
'/.workspaces'
)
return
const
path
=
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