|
|
@ -119,6 +119,7 @@ export const Workspace = (props: WorkspaceProps) => { |
|
|
|
|
|
|
|
|
|
|
|
const createNewWorkspace = async (workspaceName) => { |
|
|
|
const createNewWorkspace = async (workspaceName) => { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
await props.fileManager.closeAllFiles() |
|
|
|
await props.createWorkspace(workspaceName) |
|
|
|
await props.createWorkspace(workspaceName) |
|
|
|
await setWorkspace(workspaceName) |
|
|
|
await setWorkspace(workspaceName) |
|
|
|
toast('New default workspace has been created.') |
|
|
|
toast('New default workspace has been created.') |
|
|
@ -127,6 +128,7 @@ export const Workspace = (props: WorkspaceProps) => { |
|
|
|
console.error(e) |
|
|
|
console.error(e) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const [state, setState] = useState({ |
|
|
|
const [state, setState] = useState({ |
|
|
|
workspaces: [], |
|
|
|
workspaces: [], |
|
|
|
reset: false, |
|
|
|
reset: false, |
|
|
@ -224,6 +226,7 @@ export const Workspace = (props: WorkspaceProps) => { |
|
|
|
const workspaceName = workspaceCreateInput.current.value |
|
|
|
const workspaceName = workspaceCreateInput.current.value |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
await props.fileManager.closeAllFiles() |
|
|
|
await props.createWorkspace(workspaceName) |
|
|
|
await props.createWorkspace(workspaceName) |
|
|
|
await setWorkspace(workspaceName) |
|
|
|
await setWorkspace(workspaceName) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|