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
57bced50
Unverified
Commit
57bced50
authored
Mar 16, 2021
by
yann300
Committed by
GitHub
Mar 16, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #980 from ethereum/yann300-patch-27-1
fix switching workspaces
parents
0245336e
24af3f5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
remix-ui-workspace.tsx
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
+7
-2
No files found.
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
View file @
57bced50
...
...
@@ -81,6 +81,12 @@ export const Workspace = (props: WorkspaceProps) => {
getWorkspaces
()
},
[
props
.
workspaces
])
const
localhostDisconnect
=
()
=>
{
if
(
state
.
currentWorkspace
===
LOCALHOST
)
setWorkspace
(
props
.
workspaces
.
length
>
0
?
props
.
workspaces
[
0
]
:
NO_WORKSPACE
)
}
props
.
localhost
.
event
.
unregister
(
'disconnected'
,
localhostDisconnect
)
props
.
localhost
.
event
.
register
(
'disconnected'
,
localhostDisconnect
)
useEffect
(()
=>
{
props
.
localhost
.
event
.
register
(
'connected'
,
()
=>
{
remixdExplorer
.
show
()
...
...
@@ -88,7 +94,6 @@ export const Workspace = (props: WorkspaceProps) => {
props
.
localhost
.
event
.
register
(
'disconnected'
,
()
=>
{
remixdExplorer
.
hide
()
setWorkspace
(
props
.
workspaces
.
length
>
0
?
props
.
workspaces
[
0
]
:
NO_WORKSPACE
)
})
props
.
localhost
.
event
.
register
(
'loading'
,
()
=>
{
...
...
@@ -217,6 +222,7 @@ export const Workspace = (props: WorkspaceProps) => {
}
const
setWorkspace
=
async
(
name
)
=>
{
props
.
setWorkspace
({
name
,
isLocalhost
:
name
===
LOCALHOST
})
if
(
name
===
LOCALHOST
)
{
props
.
workspace
.
clearWorkspace
()
}
else
if
(
name
===
NO_WORKSPACE
)
{
...
...
@@ -228,7 +234,6 @@ export const Workspace = (props: WorkspaceProps) => {
setState
(
prevState
=>
{
return
{
...
prevState
,
currentWorkspace
:
name
}
})
props
.
setWorkspace
({
name
,
isLocalhost
:
name
===
LOCALHOST
})
}
const
remixdExplorer
=
{
...
...
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