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
65d17222
Commit
65d17222
authored
Jan 28, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed overwrite bug
parent
4dd9a621
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
file-explorer.tsx
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
+11
-4
No files found.
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
View file @
65d17222
...
@@ -443,13 +443,14 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -443,13 +443,14 @@ export const FileExplorer = (props: FileExplorerProps) => {
const
fileExternallyChanged
=
(
path
:
string
,
file
:
{
content
:
string
})
=>
{
const
fileExternallyChanged
=
(
path
:
string
,
file
:
{
content
:
string
})
=>
{
const
config
=
registry
.
get
(
'config'
).
api
const
config
=
registry
.
get
(
'config'
).
api
const
editor
=
registry
.
get
(
'editor'
).
api
if
(
config
.
get
(
'currentFile'
)
===
path
&&
registry
.
editor
.
currentContent
()
&&
registry
.
editor
.
currentContent
()
!==
file
.
content
)
{
if
(
config
.
get
(
'currentFile'
)
===
path
&&
editor
.
currentContent
()
!==
file
.
content
)
{
if
(
filesProvider
.
isReadOnly
(
path
))
return
registry
.
editor
.
setText
(
file
.
content
)
if
(
filesProvider
.
isReadOnly
(
path
))
return
editor
.
setText
(
file
.
content
)
modal
(
path
+
' changed'
,
'This file has been changed outside of Remix IDE.'
,
{
modal
(
path
+
' changed'
,
'This file has been changed outside of Remix IDE.'
,
{
label
:
'Replace by the new content'
,
label
:
'Replace by the new content'
,
fn
:
()
=>
{
fn
:
()
=>
{
registry
.
editor
.
setText
(
file
.
content
)
editor
.
setText
(
file
.
content
)
}
}
},
{
},
{
label
:
'Keep the content displayed in Remix'
,
label
:
'Keep the content displayed in Remix'
,
...
@@ -505,11 +506,17 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -505,11 +506,17 @@ export const FileExplorer = (props: FileExplorerProps) => {
const
success
=
await
filesProvider
.
set
(
name
,
event
.
target
.
result
)
const
success
=
await
filesProvider
.
set
(
name
,
event
.
target
.
result
)
if
(
!
success
)
{
if
(
!
success
)
{
modal
(
'File Upload Failed'
,
'Failed to create file '
+
name
,
{
return
modal
(
'File Upload Failed'
,
'Failed to create file '
+
name
,
{
label
:
'Close'
,
label
:
'Close'
,
fn
:
async
()
=>
{}
fn
:
async
()
=>
{}
},
null
)
},
null
)
}
}
const
config
=
registry
.
get
(
'config'
).
api
const
editor
=
registry
.
get
(
'editor'
).
api
if
((
config
.
get
(
'currentFile'
)
===
name
)
&&
(
editor
.
currentContent
()
!==
event
.
target
.
result
))
{
editor
.
setText
(
event
.
target
.
result
)
}
}
}
fileReader
.
readAsText
(
file
)
fileReader
.
readAsText
(
file
)
}
}
...
...
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