diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx index 50b3649..414063f 100644 --- a/src/components/SideBar.tsx +++ b/src/components/SideBar.tsx @@ -125,7 +125,7 @@ const RawGitako: React.FC = function RawGitako(props) {
- {(() => { + {run(() => { switch (state) { case 'loading-meta': return @@ -152,7 +152,7 @@ const RawGitako: React.FC = function RawGitako(props) { case 'error-due-to-auth': return } - })()} + })}
() - const foundFolders = new Set() - for (const node of nodes) { - let path = node.path - if (node.type === 'tree') foundFolders.add(path) - else { - while (true) { - // 'a/b' -> 'a' - // 'a' -> '' - path = path.substring(0, path.lastIndexOf('/')) - if (path === '') break - folders.add(path) - } - } - } - - const missingFolders: string[] = [] - for (const folder of folders) { - if (!foundFolders.has(folder)) { - missingFolders.push(folder) - } - } - - return missingFolders -} - export function useGitHubAttachCopySnippetButton(copySnippetButton: boolean) { const attachCopySnippetButton = React.useCallback( function attachCopySnippetButton() {