set current workspace to the first one by default

pull/2831/head
yann300 2 years ago committed by Aniket
parent 11b38a4e0b
commit 44b716be6e
  1. 6
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -26,7 +26,11 @@ export function Workspace () {
const initGitRepoRef = useRef<HTMLInputElement>() const initGitRepoRef = useRef<HTMLInputElement>()
useEffect(() => { useEffect(() => {
setCurrentWorkspace(localStorage.getItem('currentWorkspace') ? localStorage.getItem('currentWorkspace') : '') let workspaceName = localStorage.getItem('currentWorkspace')
if (!workspaceName && global.fs.browser.workspaces.length) {
workspaceName = global.fs.browser.workspaces[0].name
}
setCurrentWorkspace(workspaceName)
resetFocus() resetFocus()
}, []) }, [])

Loading…
Cancel
Save