From 92c4440d38818f30ce6ddb971c838026b607e5cf Mon Sep 17 00:00:00 2001 From: Tanuj Mittal Date: Mon, 21 Sep 2020 11:41:48 -0700 Subject: [PATCH] Skip refreshing pinned repos if token not available (#219) --- src/Explorer/Notebook/NotebookManager.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Explorer/Notebook/NotebookManager.ts b/src/Explorer/Notebook/NotebookManager.ts index 85b888d5a..8afab432c 100644 --- a/src/Explorer/Notebook/NotebookManager.ts +++ b/src/Explorer/Notebook/NotebookManager.ts @@ -113,11 +113,14 @@ export default class NotebookManager { this.params.resourceTree.initializeGitHubRepos(pinnedRepos); this.params.resourceTree.triggerRender(); }); - this.junoClient.getPinnedRepos(this.gitHubOAuthService.getTokenObservable()()?.scope); + this.refreshPinnedRepos(); } public refreshPinnedRepos(): void { - this.junoClient.getPinnedRepos(this.gitHubOAuthService.getTokenObservable()()?.scope); + const token = this.gitHubOAuthService.getTokenObservable()(); + if (token) { + this.junoClient.getPinnedRepos(token.scope); + } } public async openPublishNotebookPane(