mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
chore: rename useVisibleNodesGenerator
This commit is contained in:
parent
1d733fb1cf
commit
38e5ee718c
2 changed files with 9 additions and 5 deletions
|
|
@ -14,7 +14,6 @@ export function useVisibleNodesGenerator(metaData: MetaData) {
|
|||
|
||||
const catchNetworkErrors = useCatchNetworkError()
|
||||
const config = useConfigs().value
|
||||
const accessToken = config.accessToken
|
||||
const setStateContext = useLoadedContext(SideBarStateContext).onChange
|
||||
|
||||
// Only run when metadata or accessToken changes
|
||||
|
|
@ -34,7 +33,7 @@ export function useVisibleNodesGenerator(metaData: MetaData) {
|
|||
},
|
||||
'/',
|
||||
true,
|
||||
accessToken,
|
||||
config.accessToken,
|
||||
)
|
||||
if (shouldAbort()) return
|
||||
|
||||
|
|
@ -46,7 +45,12 @@ export function useVisibleNodesGenerator(metaData: MetaData) {
|
|||
defer,
|
||||
compress: config.compressSingletonFolder,
|
||||
async getTreeData(path) {
|
||||
const { root } = await platform.getTreeData(metaData, path, false, accessToken)
|
||||
const { root } = await platform.getTreeData(
|
||||
metaData,
|
||||
path,
|
||||
false,
|
||||
config.accessToken,
|
||||
)
|
||||
return root
|
||||
},
|
||||
}),
|
||||
|
|
@ -55,7 +59,7 @@ export function useVisibleNodesGenerator(metaData: MetaData) {
|
|||
setStateContext('tree-rendered')
|
||||
})
|
||||
},
|
||||
[metaData, accessToken], // eslint-disable-line react-hooks/exhaustive-deps
|
||||
[metaData, config.accessToken], // eslint-disable-line react-hooks/exhaustive-deps
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ import { useHandleNodeClick } from './hooks/useOnNodeClick'
|
|||
import { useOnSearch } from './hooks/useOnSearch'
|
||||
import { useVisibleNodesGeneratorMethods } from './hooks/useOnVisibleNodesGeneratorReady'
|
||||
import { useRenderLabelText } from './hooks/useRenderLabelText'
|
||||
import { useVisibleNodesGenerator } from './hooks/useSetupTree'
|
||||
import { useVisibleNodesGenerator } from './hooks/useVisibleNodesGenerator'
|
||||
import { ListView } from './ListView'
|
||||
import { useHandleNodeFocus } from './useHandleNodeFocus'
|
||||
import { useVisibleNodes } from './useVisibleNodes'
|
||||
|
|
|
|||
Loading…
Reference in a new issue