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
802927ef
Commit
802927ef
authored
Jun 19, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Triggered removeFile event and removed old event listener
parent
c43b0ed5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
34 deletions
+7
-34
file-explorer.js
apps/remix-ide/src/app/files/file-explorer.js
+5
-5
fileProvider.js
apps/remix-ide/src/app/files/fileProvider.js
+1
-1
remixDProvider.js
apps/remix-ide/src/app/files/remixDProvider.js
+1
-28
No files found.
apps/remix-ide/src/app/files/file-explorer.js
View file @
802927ef
...
...
@@ -141,10 +141,14 @@ function fileExplorer (localRegistry, files, menuItems) {
}
function
fileRemoved
(
filepath
)
{
var
label
=
self
.
treeView
.
labelAt
(
filepath
)
const
label
=
self
.
treeView
.
labelAt
(
filepath
)
filepath
=
filepath
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
if
(
label
&&
label
.
parentElement
)
{
label
.
parentElement
.
removeChild
(
label
)
}
self
.
updatePath
(
filepath
)
}
function
fileRenamed
(
oldName
,
newName
,
isFolder
)
{
...
...
@@ -240,8 +244,6 @@ function fileExplorer (localRegistry, files, menuItems) {
if
(
!
removeFolder
)
{
tooltip
(
`failed to remove
${
key
}
. Make sure the directory is empty before removing it.`
)
}
else
{
self
.
updatePath
(
self
.
files
.
type
)
}
},
()
=>
{})
}
...
...
@@ -284,8 +286,6 @@ function fileExplorer (localRegistry, files, menuItems) {
if
(
!
removeFile
)
{
tooltip
(
`Failed to remove file
${
key
}
.`
)
}
else
{
self
.
updatePath
(
self
.
files
.
type
)
}
},
()
=>
{}
...
...
apps/remix-ide/src/app/files/fileProvider.js
View file @
802927ef
...
...
@@ -180,6 +180,7 @@ class FileProvider {
// folder is empty
window
.
remixFileSystem
.
rmdirSync
(
path
,
console
.
log
)
}
this
.
event
.
trigger
(
'fileRemoved'
,
[
this
.
_normalizePath
(
path
)])
}
}
catch
(
e
)
{
console
.
log
(
e
)
...
...
@@ -222,7 +223,6 @@ class FileProvider {
window
.
remixFileSystem
.
readdir
(
path
,
(
error
,
files
)
=>
{
var
ret
=
{}
console
.
log
(
'files: '
,
files
)
if
(
files
)
{
files
.
forEach
(
element
=>
{
const
absPath
=
(
path
===
'/'
?
''
:
path
)
+
'/'
+
element
...
...
apps/remix-ide/src/app/files/remixDProvider.js
View file @
802927ef
...
...
@@ -37,33 +37,6 @@ module.exports = class RemixDProvider {
this
.
_appManager
.
on
(
'remixd'
,
'fileRemoved'
,
(
path
)
=>
{
this
.
event
.
trigger
(
'fileRemoved'
,
[
this
.
addPrefix
(
path
)])
})
this
.
_appManager
.
on
(
'remixd'
,
'notified'
,
(
data
)
=>
{
if
(
data
.
scope
===
'sharedfolder'
)
{
if
(
data
.
name
===
'created'
)
{
this
.
init
(()
=>
{
this
.
event
.
trigger
(
'fileAdded'
,
[
this
.
type
+
'/'
+
data
.
value
.
path
,
data
.
value
.
isReadOnly
,
data
.
value
.
isFolder
])
})
}
else
if
(
data
.
name
===
'removed'
)
{
this
.
init
(()
=>
{
this
.
event
.
trigger
(
'fileRemoved'
,
[
this
.
type
+
'/'
+
data
.
value
.
path
])
})
}
else
if
(
data
.
name
===
'changed'
)
{
this
.
_appManager
.
call
(
'remixd'
,
'get'
,
{
path
:
data
.
value
},
(
error
,
content
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
}
else
{
var
path
=
this
.
type
+
'/'
+
data
.
value
this
.
filesContent
[
path
]
=
content
this
.
event
.
trigger
(
'fileExternallyChanged'
,
[
path
,
content
])
}
})
}
else
if
(
data
.
name
===
'rootFolderChanged'
)
{
// new path has been set, we should reset
this
.
event
.
trigger
(
'folderAdded'
,
[
this
.
type
+
'/'
])
}
}
})
}
isConnected
()
{
...
...
@@ -199,7 +172,7 @@ module.exports = class RemixDProvider {
if
(
path
[
0
]
===
'/'
)
path
=
path
.
substring
(
1
)
if
(
!
path
)
return
callback
(
null
,
{
[
self
.
type
]:
{
}
})
const
unprefixedpath
=
this
.
removePrefix
(
path
)
console
.
log
(
'unprefixedpath: '
,
unprefixedpath
)
this
.
_appManager
.
call
(
'remixd'
,
'resolveDirectory'
,
{
path
:
unprefixedpath
}).
then
((
result
)
=>
{
callback
(
null
,
result
)
}).
catch
(
callback
)
...
...
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