From 28f611ad868f05ae1ba12b316fad483abcbc62f7 Mon Sep 17 00:00:00 2001 From: frelodev Date: Sat, 28 Sep 2024 12:37:44 +0200 Subject: [PATCH] fix: properly update workspaces and buffers in tree view --- src/commands/client.ts | 2 +- src/commands/workspaces.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/client.ts b/src/commands/client.ts index aa80076..169c9bf 100644 --- a/src/commands/client.ts +++ b/src/commands/client.ts @@ -143,7 +143,7 @@ export async function createWorkspace() { if (workspace_id === undefined) return; await client.create_workspace(workspace_id); vscode.window.showInformationMessage("Created new workspace " + workspace_id); - provider.refresh(); + listWorkspaces(); } export async function inviteToWorkspace() { diff --git a/src/commands/workspaces.ts b/src/commands/workspaces.ts index 0770672..592cdf9 100644 --- a/src/commands/workspaces.ts +++ b/src/commands/workspaces.ts @@ -44,9 +44,10 @@ export async function jump(selected: vscode.TreeItem | undefined){ export async function createBuffer() { let bufferName: any = (await vscode.window.showInputBox({ prompt: "path of the buffer to create" })); if (workspace === null) return vscode.window.showWarningMessage("Join a workspace first"); - workspace.create(bufferName); + await workspace.create(bufferName); vscode.window.showInformationMessage(`new buffer created :${bufferName}`); - provider.refresh(); + listBuffers(); + //provider.refresh(); } export async function listBuffers() {