Skip refreshing pinned repos if token not available (#219)

This commit is contained in:
Tanuj Mittal 2020-09-21 11:41:48 -07:00 committed by GitHub
parent 1ccffab911
commit 92c4440d38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(