mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: handle PR
This commit is contained in:
parent
391c3e457c
commit
3115f78878
2 changed files with 10 additions and 19 deletions
|
|
@ -61,17 +61,21 @@ export const setUpTree: BoundMethodCreator<[
|
|||
},
|
||||
})
|
||||
visibleNodesGenerator.onUpdate(visibleNodes => dispatch.set({ visibleNodes }))
|
||||
|
||||
dispatch.set({ state: 'done' })
|
||||
|
||||
if (platform.shouldExpandAll?.()) {
|
||||
visibleNodesGenerator.visibleNodes.nodes.forEach(node =>
|
||||
dispatch.call(toggleNodeExpansion, node, { recursive: true }),
|
||||
)
|
||||
const unsubscribe = visibleNodesGenerator.onUpdate(visibleNodes => {
|
||||
unsubscribe()
|
||||
visibleNodes.nodes.forEach(node =>
|
||||
dispatch.call(toggleNodeExpansion, node, { recursive: true }),
|
||||
)
|
||||
})
|
||||
dispatch.call(search, '')
|
||||
} else {
|
||||
const targetPath = platform.getCurrentPath(metaData.branchName)
|
||||
if (targetPath) dispatch.call(goTo, targetPath)
|
||||
else dispatch.call(search, '')
|
||||
}
|
||||
|
||||
dispatch.set({ state: 'done' })
|
||||
}
|
||||
|
||||
export const handleKeyDown: BoundMethodCreator<[React.KeyboardEvent]> = dispatch => event => {
|
||||
|
|
|
|||
|
|
@ -151,23 +151,10 @@ export const GitHub: Platform = {
|
|||
url: `https://${window.location.host}/${metaData.userName}/${
|
||||
metaData.repoName
|
||||
}/pull/${pullId}/files${window.location.search}#${id || ''}`,
|
||||
contents: undefined,
|
||||
sha: item.sha,
|
||||
}
|
||||
})
|
||||
|
||||
const missingFolders = findMissingFolders(nodes)
|
||||
nodes.push(
|
||||
...missingFolders.map(
|
||||
folder =>
|
||||
({
|
||||
name: folder.replace(/^.*\//, ''),
|
||||
path: folder,
|
||||
type: 'tree',
|
||||
} as TreeNode),
|
||||
),
|
||||
)
|
||||
|
||||
const root = processTree(nodes)
|
||||
return { root }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue