Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1627,11 +1627,11 @@
},
{
"command": "openshift.Serverless.deploy",
"when": "view == openshiftServerlessFunctionsView && viewItem =~ /^(localFunctions|localFunctionsWithBuild|localDeployFunctions)$/"
"when": "view == openshiftServerlessFunctionsView && viewItem =~ /^(localFunctions|localFunctionsWithBuild|localDeployFunctions)$/ && isLoggedIn"
},
{
"command": "openshift.Serverless.undeploy",
"when": "view == openshiftServerlessFunctionsView && viewItem =~ /^(localDeployFunctions|deployFunctions)$/"
"when": "view == openshiftServerlessFunctionsView && viewItem =~ /^(localDeployFunctions|deployFunctions)$/ && isLoggedIn"
},
{
"command": "openshift.Serverless.stopRun",
Expand Down
13 changes: 2 additions & 11 deletions src/serverlessFunction/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,15 @@ export class ServerlessFunctionView implements TreeDataProvider<ExplorerItem>, D
async getChildren(element?: ExplorerItem): Promise<ExplorerItem[]> {
let result: ExplorerItem[] = [];
if (!element) {
result = [{
kind: 'project',
metadata: {
name: this.kubeContext?.namespace,
},
} as KubernetesObject];
this.setCurrentNameSpace(this.kubeContext?.namespace);
} else if ('kind' in element) {
if (element.kind === 'project') {
result = [...await this.serverlessFunction.getLocalFunctions()]
result = [...await this.serverlessFunction.getLocalFunctions()]
if (result.length === 0) {
const functionNode: FunctionObject = {
name: 'No Available Functions',
context: FunctionStatus.NONE
}
result = [functionNode]
}
}
this.setCurrentNameSpace(this.kubeContext?.namespace);
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
}
return result;
}
Expand Down