Fixed workbench workspaces load (#2433)

This commit is contained in:
mrsadman99 2022-12-14 11:45:05 +07:00 committed by GitHub
parent 130a19daa9
commit 8093875c64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,14 +29,18 @@
export let workspaces: Workspace[]
let _workspaces: Workspace[] = []
onMount(() => {
if (workspaces.length === 0) {
getWorkspaces().then((ws: Workspace[]) => (workspaces = ws))
getWorkspaces().then((ws: Workspace[]) => (_workspaces = ws))
} else {
_workspaces = workspaces
}
})
$: actions = [
...workspaces.map((w) => ({
..._workspaces.map((w) => ({
label: getEmbeddedLabel(w.workspace),
action: async () => {
const loginInfo = (await selectWorkspace(w.workspace))[1]