mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
refactor: remove parent node
This commit is contained in:
parent
220e6a23f6
commit
db5368fef3
2 changed files with 0 additions and 11 deletions
|
|
@ -145,7 +145,6 @@ const handleKeyDown: MethodCreator<
|
|||
break
|
||||
|
||||
case 'ArrowLeft':
|
||||
// collapse node or go to parent node
|
||||
if (expandedNodes.has(focusedNode)) {
|
||||
dispatch.call(setExpand, focusedNode, false)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import GitHubHelper, { MetaData, TreeData } from 'utils/GitHubHelper'
|
|||
interface BasicItem {
|
||||
name: string | null
|
||||
path: string | null
|
||||
parent?: BasicItem | null
|
||||
mode: null
|
||||
type: string | null
|
||||
url: string | null
|
||||
|
|
@ -42,13 +41,6 @@ function sortFoldersToFront(root: Item) {
|
|||
return depthFirstSearch(root)
|
||||
}
|
||||
|
||||
function setParentNode(root: Item, parent: Item | null = null) {
|
||||
root.parent = parent
|
||||
if (root.contents) {
|
||||
root.contents.forEach(node => setParentNode(node, root))
|
||||
}
|
||||
}
|
||||
|
||||
function findGitModules(root: Item) {
|
||||
if (root.contents) {
|
||||
const modulesFile = root.contents.find(content => content.name === '.gitmodules')
|
||||
|
|
@ -97,8 +89,6 @@ function parse(treeData: TreeData, metaData: MetaData) {
|
|||
}
|
||||
})
|
||||
|
||||
setParentNode(root)
|
||||
|
||||
return {
|
||||
gitModules: findGitModules(root),
|
||||
root: sortFoldersToFront(root),
|
||||
|
|
|
|||
Loading…
Reference in a new issue