Skip to content

Commit

Permalink
Empty state bug
Browse files Browse the repository at this point in the history
  • Loading branch information
suhay committed Feb 22, 2021
1 parent aea2cba commit 5bf25be
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/editorDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class EditorDocument {
public label?: string,
) {
this.viewColumn = viewColumn || vscode.ViewColumn.One;
this.label = label ?? document.fileName;
this.label = label ?? document?.fileName ?? '';
this.contextValue = 'editorDocument';
}

Expand Down
2 changes: 1 addition & 1 deletion src/editorGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class EditorGroup extends vscode.TreeItem {

private get _description(): string[] {
const root = vscode.workspace.workspaceFolders?.[0]?.uri?.path ?? '';
return (this.documents || []).map(({ document }) => document.fileName.replace(`${root}/`, ''));
return (this.documents || []).map(({ document }) => document?.fileName.replace(`${root}/`, ''));
}

get parent(): EditorGroup | undefined {
Expand Down
2 changes: 1 addition & 1 deletion src/editorGroupTreeDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class EditorGroupTreeDataProvider implements vscode.TreeDataProvider<Edit
if (element) {
const root = vscode.workspace.workspaceFolders?.[0]?.uri?.path ?? '';
const documents = (element.documents || []).map(({ document }) => {
const groupMember = new EditorGroup(document.fileName.replace(`${root}/`, ''));
const groupMember = new EditorGroup(document?.fileName.replace(`${root}/`, ''));
groupMember.parent = element;
return groupMember;
});
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"outDir": "dist",
"lib": [
"es6"
],
Expand Down

0 comments on commit 5bf25be

Please sign in to comment.