mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
chore: code clean
This commit is contained in:
parent
31f803a03f
commit
5c25d9d0d8
2 changed files with 2 additions and 29 deletions
|
|
@ -125,7 +125,7 @@ const RawGitako: React.FC<Props & ConnectorState> = function RawGitako(props) {
|
|||
</button>
|
||||
</div>
|
||||
<div className={'gitako-side-bar-content'}>
|
||||
{(() => {
|
||||
{run(() => {
|
||||
switch (state) {
|
||||
case 'loading-meta':
|
||||
return <LoadingIndicator text={'Fetching repo meta...'} />
|
||||
|
|
@ -152,7 +152,7 @@ const RawGitako: React.FC<Props & ConnectorState> = function RawGitako(props) {
|
|||
case 'error-due-to-auth':
|
||||
return <AccessDeniedDescription hasToken={Boolean(accessToken)} />
|
||||
}
|
||||
})()}
|
||||
})}
|
||||
</div>
|
||||
<SettingsBar
|
||||
defer={defer}
|
||||
|
|
|
|||
|
|
@ -281,33 +281,6 @@ async function createPullFileResolver(userName: string, repoName: string, pullId
|
|||
}
|
||||
}
|
||||
|
||||
function findMissingFolders(nodes: TreeNode[]) {
|
||||
const folders = new Set<string>()
|
||||
const foundFolders = new Set<string>()
|
||||
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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue