From b2ca229e60bcb715dfff48a13015f09c19aba240 Mon Sep 17 00:00:00 2001 From: Barbara Valdez <34872381+barbaravaldez@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:59:08 -0700 Subject: [PATCH] Fix unpin notebook (#20393) (#20397) * convert uri to vscode uri --- extensions/notebook/src/book/bookTreeView.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/notebook/src/book/bookTreeView.ts b/extensions/notebook/src/book/bookTreeView.ts index 1d859dff99..4f993b5fe6 100644 --- a/extensions/notebook/src/book/bookTreeView.ts +++ b/extensions/notebook/src/book/bookTreeView.ts @@ -151,8 +151,10 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider book.bookPath === bookTreeItem.book.contentPath)?.getNotebook(bookTreeItem.book.contentPath); + let itemOpenedInBookTreeView = this.currentBook?.getNotebook(notebookUri) ?? this.books.find(book => book.bookPath === bookTreeItem.book.contentPath)?.getNotebook(notebookUri); if (itemOpenedInBookTreeView) { itemOpenedInBookTreeView.contextValue = bookTreeItem.contextValue; this._onDidChangeTreeData.fire(itemOpenedInBookTreeView.parent);