feat: don't show join button on viewtree if you already joined another workspace

This commit is contained in:
frelodev 2024-09-18 16:14:54 +02:00
parent e4b740f6d4
commit 9fd0b7e732
2 changed files with 20 additions and 20 deletions

View file

@ -15,18 +15,18 @@
"theme": "dark"
},
"keywords": [
"codemp",
"collaborative",
"editing",
"multiplatform",
"live",
"development"
"codemp",
"collaborative",
"editing",
"multiplatform",
"live",
"development"
],
"categories": [
"SCM Providers",
"Visualization",
"Programming Languages",
"Other"
"SCM Providers",
"Visualization",
"Programming Languages",
"Other"
],
"activationEvents": [
"onCommand:extension.openMyExtension"
@ -34,13 +34,13 @@
"main": "./out/extension.js",
"contributes": {
"viewsContainers": {
"activitybar": [
{
"id": "codemp-tree-container",
"title": "codemp",
"icon": "resources/logo.svg"
}
]
"activitybar": [
{
"id": "codemp-tree-container",
"title": "codemp",
"icon": "resources/logo.svg"
}
]
},
"viewsWelcome": [
{
@ -74,7 +74,7 @@
"view/item/context": [
{
"command": "codemp.join",
"when": "view == codemp-tree-view && viewItem == workspace",
"when": "view == codemp-tree-view && viewItem == workspace_active",
"group": "inline"
},
{
@ -228,4 +228,4 @@
"dependencies": {
"codemp": "^0.0.10"
}
}
}

View file

@ -62,7 +62,7 @@ export class CodempTreeProvider implements vscode.TreeDataProvider<CodempTreeIte
return out;
}
let items = workspace_list.map((x) =>
new CodempTreeItem(x, Type.Workspace, true, workspace !== null && workspace.id() == x)
new CodempTreeItem(x, Type.Workspace, true, workspace === null)
);
items.push(new CodempTreeItem("", Type.Placeholder, false));
items.push(new CodempTreeItem("<Users>", Type.UserList, true));