mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-03-25 03:05:24 +00:00
Fix connect to github (#951)
This commit is contained in:
parent
c5e4ee9c2b
commit
401660ae15
@ -153,35 +153,31 @@ export const useNotebook: UseStore<NotebookState> = create((set, get) => ({
|
|||||||
set({ myNotebooksContentRoot: root });
|
set({ myNotebooksContentRoot: root });
|
||||||
},
|
},
|
||||||
initializeNotebooksTree: async (notebookManager: NotebookManager): Promise<void> => {
|
initializeNotebooksTree: async (notebookManager: NotebookManager): Promise<void> => {
|
||||||
set({
|
const myNotebooksContentRoot = {
|
||||||
myNotebooksContentRoot: {
|
|
||||||
name: "My Notebooks",
|
name: "My Notebooks",
|
||||||
path: get().notebookBasePath,
|
path: get().notebookBasePath,
|
||||||
type: NotebookContentItemType.Directory,
|
type: NotebookContentItemType.Directory,
|
||||||
},
|
};
|
||||||
galleryContentRoot: {
|
const galleryContentRoot = {
|
||||||
name: "Gallery",
|
name: "Gallery",
|
||||||
path: "Gallery",
|
path: "Gallery",
|
||||||
type: NotebookContentItemType.File,
|
type: NotebookContentItemType.File,
|
||||||
},
|
};
|
||||||
});
|
const gitHubNotebooksContentRoot = notebookManager?.gitHubOAuthService?.isLoggedIn()
|
||||||
|
? {
|
||||||
if (notebookManager?.gitHubOAuthService?.isLoggedIn()) {
|
|
||||||
set({
|
|
||||||
gitHubNotebooksContentRoot: {
|
|
||||||
name: "GitHub repos",
|
name: "GitHub repos",
|
||||||
path: "PsuedoDir",
|
path: "PsuedoDir",
|
||||||
type: NotebookContentItemType.Directory,
|
type: NotebookContentItemType.Directory,
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
: undefined;
|
||||||
|
set({
|
||||||
|
myNotebooksContentRoot,
|
||||||
|
galleryContentRoot,
|
||||||
|
gitHubNotebooksContentRoot,
|
||||||
|
});
|
||||||
|
|
||||||
if (get().notebookServerInfo?.notebookServerEndpoint) {
|
if (get().notebookServerInfo?.notebookServerEndpoint) {
|
||||||
const updatedRoot = await notebookManager?.notebookContentClient?.updateItemChildren({
|
const updatedRoot = await notebookManager?.notebookContentClient?.updateItemChildren(myNotebooksContentRoot);
|
||||||
name: "My Notebooks",
|
|
||||||
path: get().notebookBasePath,
|
|
||||||
type: NotebookContentItemType.Directory,
|
|
||||||
});
|
|
||||||
set({ myNotebooksContentRoot: updatedRoot });
|
set({ myNotebooksContentRoot: updatedRoot });
|
||||||
|
|
||||||
if (updatedRoot?.children) {
|
if (updatedRoot?.children) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user