Fix search icon only working when section expanded (#9596)

This commit is contained in:
Chris LaFreniere
2020-03-12 21:35:38 -07:00
committed by GitHub
parent 6652801861
commit 7658a5df28

View File

@@ -45,7 +45,7 @@ export class BookTreeItem extends vscode.TreeItem {
this.contextValue = 'savedBook'; this.contextValue = 'savedBook';
} }
} else { } else {
if (book.type === BookTreeItemType.Markdown && book.page.expand_sections) { if (book.page && book.page.sections && book.page.sections.length > 0) {
this.contextValue = 'section'; this.contextValue = 'section';
} }
this.setPageVariables(); this.setPageVariables();