v0.0.3 hotfix (#6)

* Prevent errors when user has no projects

* edit changelog and bump version
This commit is contained in:
Alex Weininger 2021-04-30 01:53:33 -07:00 committed by GitHub
parent 7ace94ffdc
commit d4b05a0728
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View file

@ -4,6 +4,11 @@ All notable changes to the "vscode-appwrite" extension will be documented in thi
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [0.0.3] - 2021-4-30
### Fixed
- Errors when user has no projects
## [0.0.2] - 2021-4-30
### Added

View file

@ -2,7 +2,7 @@
"name": "vscode-appwrite",
"displayName": "Appwrite",
"description": "Manage your Appwrite resources right from VS Code!",
"version": "0.0.2",
"version": "0.0.3",
"engines": {
"vscode": "^1.55.0"
},

View file

@ -32,6 +32,11 @@ export class HealthTreeItemProvider implements vscode.TreeDataProvider<vscode.Tr
}
async getChildren(element?: HealthTreeItem): Promise<vscode.TreeItem[]> {
if (healthClient === undefined) {
return [];
}
// get children for root
if (element === undefined) {
const health = await healthClient.checkup();

View file

@ -20,9 +20,13 @@ export class StorageTreeItemProvider implements vscode.TreeDataProvider<vscode.T
}
async getChildren(element?: vscode.TreeItem): Promise<vscode.TreeItem[]> {
if (storageClient === undefined) {
return [];
}
const files = await storageClient.listFiles();
if (files === undefined || files?.files.length === 0) {
const noStorage = new vscode.TreeItem('No files found');
const noStorage = new vscode.TreeItem("No files found");
return [noStorage];
}
return files.files.map((file) => new FileTreeItem(file));