set current workspace to the first one by default

pull/5370/head
yann300 2 years ago committed by Aniket
parent 58ce03f96b
commit b2fe4b0981
  1. 6
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -26,7 +26,11 @@ export function Workspace () {
const initGitRepoRef = useRef<HTMLInputElement>()
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()
}, [])

Loading…
Cancel
Save