cleanup workspaces useEffect after unmount

pull/1250/head
ioedeveloper 4 years ago
parent f974fcf823
commit 36d31f8b8f
  1. 6
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -71,7 +71,7 @@ export const Workspace = (props: WorkspaceProps) => {
}
useEffect(() => {
const getWorkspaces = async () => {
let getWorkspaces = async () => {
if (props.workspaces && Array.isArray(props.workspaces)) {
if (props.workspaces.length > 0 && state.currentWorkspace === NO_WORKSPACE) {
props.workspace.setWorkspace(props.workspaces[0])
@ -87,6 +87,10 @@ export const Workspace = (props: WorkspaceProps) => {
}
getWorkspaces()
return () => {
getWorkspaces = async () => {}
}
}, [props.workspaces])
const localhostDisconnect = () => {

Loading…
Cancel
Save